gm-cc 2.0.286 → 2.0.287

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.286",
7
+ "version": "2.0.287",
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.286",
3
+ "version": "2.0.287",
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.286",
3
+ "version": "2.0.287",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",
@@ -10,6 +10,7 @@ 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
  const pendingPath = binPath + '.pending';
13
+ const versionFile = path.join(pluginRoot, 'bin', '.plugkit-version');
13
14
 
14
15
  function getAssetName() {
15
16
  const platform = process.platform;
@@ -20,11 +21,16 @@ function getAssetName() {
20
21
  return `plugkit-${os}-${cpu}${ext}`;
21
22
  }
22
23
 
24
+ const pendingVersionFile = pendingPath + '.version';
25
+
23
26
  function applyPending() {
24
27
  if (!fs.existsSync(pendingPath)) return;
25
28
  try {
26
29
  if (fs.existsSync(binPath)) fs.unlinkSync(binPath);
27
30
  fs.renameSync(pendingPath, binPath);
31
+ if (fs.existsSync(pendingVersionFile)) {
32
+ try { fs.renameSync(pendingVersionFile, versionFile); } catch {}
33
+ }
28
34
  } catch {}
29
35
  }
30
36
 
@@ -39,10 +45,7 @@ function getVersion() {
39
45
  function getCurrentVersion() {
40
46
  if (!fs.existsSync(binPath)) return null;
41
47
  try {
42
- const { execFileSync } = require('child_process');
43
- const out = execFileSync(binPath, ['--version'], { timeout: 5000 }).toString().trim();
44
- const m = out.match(/(\d+\.\d+\.\d+)/);
45
- return m ? m[1] : null;
48
+ return fs.readFileSync(versionFile, 'utf8').trim() || null;
46
49
  } catch { return null; }
47
50
  }
48
51
 
@@ -78,6 +81,7 @@ download(required, binPath, (err) => {
78
81
  process.stderr.write(`bootstrap: ${err2.message}\n`);
79
82
  process.exit(fs.existsSync(binPath) ? 0 : 1);
80
83
  }
84
+ try { fs.writeFileSync(pendingVersionFile, required); } catch {}
81
85
  process.exit(0);
82
86
  });
83
87
  return;
@@ -86,5 +90,6 @@ download(required, binPath, (err) => {
86
90
  process.stderr.write(`bootstrap: ${err.message}\n`);
87
91
  process.exit(fs.existsSync(binPath) ? 0 : 1);
88
92
  }
93
+ try { fs.writeFileSync(versionFile, required); } catch {}
89
94
  process.exit(0);
90
95
  });