tokenizor-mcp 0.3.0 → 0.3.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.

Potentially problematic release.


This version of tokenizor-mcp might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/install.js +24 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenizor-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Tokenizor MCP — in-memory code intelligence with parasitic hook integration for Claude Code",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -53,16 +53,35 @@ function download(url) {
53
53
  });
54
54
  }
55
55
 
56
+ function getInstalledVersion(binPath) {
57
+ try {
58
+ const output = execSync(`"${binPath}" --version`, {
59
+ encoding: "utf8",
60
+ timeout: 5000,
61
+ }).trim();
62
+ // Output format: "tokenizor-mcp x.y.z" or just "x.y.z"
63
+ const match = output.match(/(\d+\.\d+\.\d+)/);
64
+ return match ? match[1] : null;
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+
56
70
  async function main() {
57
71
  const binPath = getBinaryPath();
72
+ const version = getVersion();
58
73
 
59
- // Skip if binary already exists
74
+ // Skip only if binary exists AND matches the expected version
60
75
  if (fs.existsSync(binPath)) {
61
- console.log("tokenizor-mcp binary already installed.");
62
- return;
76
+ const installed = getInstalledVersion(binPath);
77
+ if (installed === version) {
78
+ console.log(`tokenizor-mcp v${version} already installed.`);
79
+ return;
80
+ }
81
+ console.log(
82
+ `tokenizor-mcp binary exists (v${installed || "unknown"}) but package wants v${version}. Updating...`
83
+ );
63
84
  }
64
-
65
- const version = getVersion();
66
85
  const artifact = getPlatformArtifact();
67
86
  const url = `https://github.com/${REPO}/releases/download/v${version}/${artifact}`;
68
87