gsd-lite 0.5.8 → 0.5.9
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.
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"name": "gsd",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "AI orchestration tool — GSD management shell + Superpowers quality core. 5 commands, 4 agents, 5 workflows, MCP server, context monitoring.",
|
|
16
|
-
"version": "0.5.
|
|
16
|
+
"version": "0.5.9",
|
|
17
17
|
"keywords": [
|
|
18
18
|
"orchestration",
|
|
19
19
|
"mcp",
|
|
@@ -227,6 +227,14 @@ function isDevMode() {
|
|
|
227
227
|
|
|
228
228
|
function getInstallMode() {
|
|
229
229
|
if (isDevMode()) return 'dev';
|
|
230
|
+
// Check if installed as a Claude Code plugin (installed_plugins.json has gsd entry)
|
|
231
|
+
// Hook files live at ~/.claude/hooks/ so pluginRoot (=__dirname/..) equals claudeDir,
|
|
232
|
+
// but that doesn't mean it's a manual install — check the plugin registry first.
|
|
233
|
+
try {
|
|
234
|
+
const pluginsFile = path.join(claudeDir, 'plugins', 'installed_plugins.json');
|
|
235
|
+
const plugins = JSON.parse(fs.readFileSync(pluginsFile, 'utf8'));
|
|
236
|
+
if (plugins.plugins?.['gsd@gsd']?.[0]) return 'plugin';
|
|
237
|
+
} catch { /* fall through */ }
|
|
230
238
|
return path.resolve(pluginRoot) === path.resolve(claudeDir)
|
|
231
239
|
? 'manual'
|
|
232
240
|
: 'plugin';
|
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -8,20 +8,30 @@ import { init, read, update, phaseComplete } from './tools/state.js';
|
|
|
8
8
|
const _require = createRequire(import.meta.url);
|
|
9
9
|
const PKG_VERSION = _require('../package.json').version;
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
// Version drift detection: warn when running code differs from disk or plugin cache
|
|
12
|
+
const _fs = _require('node:fs');
|
|
13
|
+
const _path = _require('node:path');
|
|
14
|
+
const _os = _require('node:os');
|
|
15
15
|
function _checkVersionDrift() {
|
|
16
|
-
if (!_isDevMode) return null;
|
|
17
16
|
try {
|
|
18
|
-
//
|
|
17
|
+
// Strategy 1: Check package.json on disk (dev mode)
|
|
19
18
|
const pkgPath = _require.resolve('../package.json');
|
|
20
19
|
delete _require.cache[pkgPath];
|
|
21
20
|
const diskVersion = _require('../package.json').version;
|
|
22
21
|
if (diskVersion !== PKG_VERSION) {
|
|
23
22
|
return `⚠️ GSD server running v${PKG_VERSION} but code on disk is v${diskVersion}. Run /mcp to restart.`;
|
|
24
23
|
}
|
|
24
|
+
|
|
25
|
+
// Strategy 2: Check plugin cache registry (plugin mode)
|
|
26
|
+
const claudeDir = process.env.CLAUDE_CONFIG_DIR || _path.join(_os.homedir(), '.claude');
|
|
27
|
+
const pluginsFile = _path.join(claudeDir, 'plugins', 'installed_plugins.json');
|
|
28
|
+
if (_fs.existsSync(pluginsFile)) {
|
|
29
|
+
const plugins = JSON.parse(_fs.readFileSync(pluginsFile, 'utf8'));
|
|
30
|
+
const gsdEntry = plugins.plugins?.['gsd@gsd']?.[0];
|
|
31
|
+
if (gsdEntry?.version && gsdEntry.version !== PKG_VERSION) {
|
|
32
|
+
return `⚠️ GSD server running v${PKG_VERSION} but plugin registry has v${gsdEntry.version}. Run /mcp to restart.`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
} catch { /* ignore */ }
|
|
26
36
|
return null;
|
|
27
37
|
}
|