From f65c7d9a892a604e75ce0f5a83b20e7160c1fa21 Mon Sep 17 00:00:00 2001 From: Kailas Mahavarkar <66670953+KailasMahavarkar@users.noreply.github.com> Date: Wed, 24 Jun 2026 02:08:07 +0530 Subject: [PATCH] fix(setup): read plugin version from package.json, not hardcoded 1.0.0 registerClaudeCodePlugin stamped marketplace + installed_plugins + the cache leaf dir as '1.0.0' regardless of actual version. Now reads package.json so the plugin registers under its real version. --- src/internal/setup-hyperstack.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/internal/setup-hyperstack.ts b/src/internal/setup-hyperstack.ts index df79934..f931563 100644 --- a/src/internal/setup-hyperstack.ts +++ b/src/internal/setup-hyperstack.ts @@ -390,6 +390,10 @@ export function registerClaudeCodePlugin(pluginRoot: string): void { const home = os.homedir(); const claudeDir = path.join(home, ".claude"); const settingsPath = path.join(claudeDir, "settings.json"); + const pkgVersion: string = (() => { + try { return JSON.parse(fs.readFileSync(path.join(pluginRoot, "package.json"), "utf8")).version; } + catch { return "0.0.0"; } + })(); if (!fs.existsSync(settingsPath)) { console.log("ℹ️ Claude Code not detected (no ~/.claude/settings.json). Skipping plugin registration."); @@ -412,14 +416,14 @@ export function registerClaudeCodePlugin(pluginRoot: string): void { }, metadata: { description: "Disciplined MCP server + skill system. Iron Laws, 1% Rule, rationalization tables, SessionStart hook injection.", - version: "1.0.0", + version: pkgVersion, }, plugins: [ { name: "hyperstack", source: "./", description: "Disciplined MCP server + skill system with adversarial enforcement gates.", - version: "1.0.0", + version: pkgVersion, category: "productivity", strict: true, }, @@ -432,7 +436,7 @@ export function registerClaudeCodePlugin(pluginRoot: string): void { // 2-3. Create symlinks (or directory copies on Windows if symlink fails) // installPath must point to the versioned leaf so Claude Code can find skills/ at /skills/ - const version = "1.0.0"; + const version = pkgVersion; const marketplaceLink = path.join(claudeDir, "plugins", "marketplaces", "hyperstack"); const cachePackageDir = path.join(claudeDir, "plugins", "cache", "hyperstack", "hyperstack"); const cacheLink = path.join(cachePackageDir, version); @@ -476,7 +480,7 @@ export function registerClaudeCodePlugin(pluginRoot: string): void { { scope: "user", installPath: cacheLink, - version: "1.0.0", + version: pkgVersion, installedAt: now, lastUpdated: now, },