skilltotal 0.69.0 → 0.70.0

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/bin/skilltotal.js CHANGED
@@ -8,6 +8,7 @@ const {
8
8
  helpText,
9
9
  noCurrentDirectoryLookup,
10
10
  resolveCommand,
11
+ versionWarning,
11
12
  } = require("../lib/runner");
12
13
  const { version } = require("../package.json");
13
14
 
@@ -20,6 +21,8 @@ if (!runner) {
20
21
  process.stderr.write(helpText(version));
21
22
  process.exit(127);
22
23
  }
24
+ // stderr only: in MCP mode stdout carries JSON-RPC and nothing else.
25
+ process.stderr.write(versionWarning(version, runner));
23
26
 
24
27
  // stdio is inherited untouched, so `npx -y skilltotal mcp` speaks MCP over this process's
25
28
  // stdin/stdout and the exit code (e.g. --fail-on-high in CI) passes through.
package/lib/runner.js CHANGED
@@ -68,7 +68,9 @@ function candidates(version, platform = process.platform) {
68
68
  args: [...pre, "-P", "-m", PACKAGE],
69
69
  // Only a Python that already has the engine counts: never pip-install on the user's behalf.
70
70
  // The probe keeps the directory off sys.path too; a Python without -P (3.10) is passed over.
71
- probe: [...pre, "-P", "-c", `import ${PACKAGE}`],
71
+ // It prints the installed version, which may not be this package's (versionWarning).
72
+ probe: [...pre, "-P", "-c", `import ${PACKAGE}; print(${PACKAGE}.__version__)`],
73
+ reportsVersion: true,
72
74
  })),
73
75
  ];
74
76
  }
@@ -81,16 +83,40 @@ function choose(version, available, platform = process.platform) {
81
83
  return null;
82
84
  }
83
85
 
84
- /** True when the candidate's probe command runs and exits 0. */
86
+ /**
87
+ * True when the candidate's probe command runs and exits 0. A probe that prints the engine's
88
+ * version leaves it on the candidate as `installed`.
89
+ */
85
90
  function isAvailable(candidate) {
86
91
  const cmd = resolveCommand(candidate.cmd);
87
92
  if (!cmd) return false;
88
93
  const r = spawnSync(cmd, candidate.probe, {
89
- stdio: "ignore",
94
+ stdio: ["ignore", candidate.reportsVersion ? "pipe" : "ignore", "ignore"],
95
+ encoding: "utf8",
90
96
  windowsHide: true,
91
97
  timeout: 20000,
92
98
  });
93
- return !r.error && r.status === 0;
99
+ if (r.error || r.status !== 0) return false;
100
+ if (candidate.reportsVersion) {
101
+ const first = String(r.stdout || "").trim().split(/\r?\n/)[0];
102
+ candidate.installed = /^[0-9][0-9A-Za-z.+-]{0,40}$/.test(first) ? first : "";
103
+ }
104
+ return true;
105
+ }
106
+
107
+ /**
108
+ * For stderr (stdout may be an MCP session): an installed Python skilltotal runs whatever release
109
+ * it is, which can differ from this npm package's. Empty when it is the same or unknown, and for
110
+ * uvx and pipx, which run the matching release.
111
+ */
112
+ function versionWarning(version, candidate) {
113
+ if (!candidate || !candidate.reportsVersion || !candidate.installed) return "";
114
+ if (candidate.installed === version) return "";
115
+ return (
116
+ `skilltotal: npm package ${version} is running the installed Python skilltotal ` +
117
+ `${candidate.installed}, a different release. Update it (pipx upgrade skilltotal or ` +
118
+ `pip install -U skilltotal==${version}), or install uv so the matching release runs.\n`
119
+ );
94
120
  }
95
121
 
96
122
  function helpText(version) {
@@ -113,4 +139,5 @@ module.exports = {
113
139
  helpText,
114
140
  noCurrentDirectoryLookup,
115
141
  resolveCommand,
142
+ versionWarning,
116
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilltotal",
3
- "version": "0.69.0",
3
+ "version": "0.70.0",
4
4
  "description": "Static security scanner for MCP servers, agent skills and npm/PyPI packages. Runs the skilltotal Python engine through uvx, pipx or an installed Python.",
5
5
  "keywords": [
6
6
  "mcp",