gm-cc 2.0.258 → 2.0.260

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.
@@ -4,7 +4,7 @@
4
4
  "name": "AnEntrypoint"
5
5
  },
6
6
  "description": "State machine agent with hooks, skills, and automated git enforcement",
7
- "version": "2.0.258",
7
+ "version": "2.0.260",
8
8
  "metadata": {
9
9
  "description": "State machine agent with hooks, skills, and automated git enforcement"
10
10
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-cc",
3
- "version": "2.0.258",
3
+ "version": "2.0.260",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.258",
3
+ "version": "2.0.260",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",
@@ -10,14 +10,26 @@ if (!pluginRoot) process.exit(0);
10
10
  const IS_WIN = process.platform === 'win32';
11
11
  const binPath = path.join(pluginRoot, 'bin', IS_WIN ? 'plugkit.exe' : 'plugkit');
12
12
 
13
- if (fs.existsSync(binPath)) process.exit(0);
14
-
15
13
  function getVersion() {
16
14
  try {
17
15
  return JSON.parse(fs.readFileSync(path.join(pluginRoot, 'gm.json'), 'utf8')).plugkitVersion || null;
18
16
  } catch { return null; }
19
17
  }
20
18
 
19
+ function getCurrentVersion() {
20
+ if (!fs.existsSync(binPath)) return null;
21
+ try {
22
+ const { execFileSync } = require('child_process');
23
+ const out = execFileSync(binPath, ['--version'], { timeout: 5000 }).toString().trim();
24
+ const m = out.match(/(\d+\.\d+\.\d+)/);
25
+ return m ? m[1] : null;
26
+ } catch { return null; }
27
+ }
28
+
29
+ const required = getVersion();
30
+ const current = getCurrentVersion();
31
+ if (current && current === required) process.exit(0);
32
+
21
33
  function download(version, dest, cb) {
22
34
  const asset = IS_WIN ? 'plugkit.exe' : 'plugkit';
23
35
  const urlPath = version
@@ -39,7 +51,7 @@ function download(version, dest, cb) {
39
51
  follow(`https://github.com${urlPath}`);
40
52
  }
41
53
 
42
- download(getVersion(), binPath, (err) => {
54
+ download(required, binPath, (err) => {
43
55
  if (err) { process.stderr.write(`bootstrap: ${err.message}\n`); process.exit(1); }
44
56
  process.exit(0);
45
57
  });