gm-cc 2.0.708 → 2.0.709
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/bin/plugkit.js +34 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
|
@@ -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.
|
|
7
|
+
"version": "2.0.709",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "State machine agent with hooks, skills, and automated git enforcement"
|
|
10
10
|
},
|
package/bin/plugkit.js
CHANGED
|
@@ -7,10 +7,42 @@ const { bootstrap, resolveCachedBinary } = require('./bootstrap');
|
|
|
7
7
|
|
|
8
8
|
const dir = __dirname;
|
|
9
9
|
|
|
10
|
+
function syncToGmTools(bin) {
|
|
11
|
+
try {
|
|
12
|
+
const os = require('os');
|
|
13
|
+
const home = process.env.HOME || process.env.USERPROFILE;
|
|
14
|
+
if (!home) return;
|
|
15
|
+
const toolsDir = path.join(home, '.claude', 'gm-tools');
|
|
16
|
+
fs.mkdirSync(toolsDir, { recursive: true });
|
|
17
|
+
const plat = os.platform();
|
|
18
|
+
const target = path.join(toolsDir, plat === 'win32' ? 'plugkit.exe' : 'plugkit');
|
|
19
|
+
let needCopy = true;
|
|
20
|
+
try {
|
|
21
|
+
const a = fs.statSync(bin);
|
|
22
|
+
const b = fs.statSync(target);
|
|
23
|
+
if (a.size === b.size && Math.abs(a.mtimeMs - b.mtimeMs) < 2000) needCopy = false;
|
|
24
|
+
} catch (_) { /* target missing — copy */ }
|
|
25
|
+
if (!needCopy) return;
|
|
26
|
+
const tmp = target + '.new';
|
|
27
|
+
fs.copyFileSync(bin, tmp);
|
|
28
|
+
try {
|
|
29
|
+
fs.renameSync(tmp, target);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
if (err.code === 'EBUSY' || err.code === 'EPERM') {
|
|
32
|
+
try { fs.unlinkSync(tmp); } catch (_) {}
|
|
33
|
+
} else {
|
|
34
|
+
throw err;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} catch (_) { /* best-effort */ }
|
|
38
|
+
}
|
|
39
|
+
|
|
10
40
|
async function resolveBinary() {
|
|
11
41
|
const cached = resolveCachedBinary({ wrapperDir: dir });
|
|
12
|
-
if (cached) return cached;
|
|
13
|
-
|
|
42
|
+
if (cached) { syncToGmTools(cached); return cached; }
|
|
43
|
+
const bin = await bootstrap({ wrapperDir: dir });
|
|
44
|
+
syncToGmTools(bin);
|
|
45
|
+
return bin;
|
|
14
46
|
}
|
|
15
47
|
|
|
16
48
|
async function main() {
|
package/package.json
CHANGED