gm-cc 2.0.298 → 2.0.301
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/package.json +1 -1
- package/plugin.json +1 -1
- package/scripts/bootstrap.js +4 -12
|
@@ -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.301",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "State machine agent with hooks, skills, and automated git enforcement"
|
|
10
10
|
},
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/scripts/bootstrap.js
CHANGED
|
@@ -63,30 +63,22 @@ function download(version, dest, cb) {
|
|
|
63
63
|
const asset = getAssetName();
|
|
64
64
|
const urlPath = `/AnEntrypoint/rs-plugkit/releases/download/v${version}/${asset}`;
|
|
65
65
|
if (!fs.existsSync(path.dirname(dest))) fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
66
|
-
let done = false;
|
|
67
|
-
const timer = setTimeout(() => { if (!done) { done = true; cb(new Error('download timeout')); } }, 30000);
|
|
68
66
|
const follow = (url) => {
|
|
69
67
|
const mod = url.startsWith('https') ? https : require('http');
|
|
70
|
-
const opts = { ...require('url').parse(url), headers: { 'User-Agent': 'gm-bootstrap' }
|
|
71
|
-
|
|
72
|
-
if (done) return res.destroy();
|
|
68
|
+
const opts = { ...require('url').parse(url), headers: { 'User-Agent': 'gm-bootstrap' } };
|
|
69
|
+
mod.get(opts, res => {
|
|
73
70
|
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) return follow(res.headers.location);
|
|
74
|
-
if (res.statusCode !== 200)
|
|
71
|
+
if (res.statusCode !== 200) return cb(new Error(`HTTP ${res.statusCode}`));
|
|
75
72
|
const chunks = [];
|
|
76
73
|
res.on('data', c => chunks.push(c));
|
|
77
74
|
res.on('end', () => {
|
|
78
|
-
clearTimeout(timer);
|
|
79
|
-
if (done) return;
|
|
80
|
-
done = true;
|
|
81
75
|
try {
|
|
82
76
|
fs.writeFileSync(dest, Buffer.concat(chunks));
|
|
83
77
|
try { fs.chmodSync(dest, 0o755); } catch {}
|
|
84
78
|
cb(null);
|
|
85
79
|
} catch (e) { cb(e); }
|
|
86
80
|
});
|
|
87
|
-
});
|
|
88
|
-
req.on('error', (e) => { clearTimeout(timer); if (!done) { done = true; cb(e); } });
|
|
89
|
-
req.on('timeout', () => { req.destroy(); clearTimeout(timer); if (!done) { done = true; cb(new Error('connect timeout')); } });
|
|
81
|
+
}).on('error', cb);
|
|
90
82
|
};
|
|
91
83
|
follow(`https://github.com${urlPath}`);
|
|
92
84
|
}
|