gm-skill 2.0.1327 → 2.0.1329
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/gm-plugkit/bootstrap.js +62 -0
- package/gm-plugkit/package.json +3 -2
- package/gm.json +1 -1
- package/package.json +1 -1
package/gm-plugkit/bootstrap.js
CHANGED
|
@@ -661,6 +661,66 @@ function ensureWrapperFresh() {
|
|
|
661
661
|
} catch (_) { return false; }
|
|
662
662
|
}
|
|
663
663
|
|
|
664
|
+
function ensureSkillMdFresh() {
|
|
665
|
+
try {
|
|
666
|
+
const candidates = [
|
|
667
|
+
path.join(__dirname, 'SKILL.md'),
|
|
668
|
+
path.join(__dirname, '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
|
|
669
|
+
path.join(__dirname, '..', '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
|
|
670
|
+
path.join(__dirname, '..', 'skills', 'gm-skill', 'SKILL.md'),
|
|
671
|
+
];
|
|
672
|
+
const bundledPath = candidates.find(p => {
|
|
673
|
+
try { return fs.existsSync(p); } catch (_) { return false; }
|
|
674
|
+
});
|
|
675
|
+
if (!bundledPath) {
|
|
676
|
+
try {
|
|
677
|
+
obsEvent('bootstrap', 'skill-md.refresh.bundled-not-found', { searched: candidates });
|
|
678
|
+
} catch (_) {}
|
|
679
|
+
return { skipped: 'bundled-not-found' };
|
|
680
|
+
}
|
|
681
|
+
const bundled = fs.readFileSync(bundledPath, 'utf-8');
|
|
682
|
+
const crypto = require('crypto');
|
|
683
|
+
const bundledHash = crypto.createHash('sha256').update(bundled).digest('hex');
|
|
684
|
+
const home = process.env.HOME || process.env.USERPROFILE || require('os').homedir();
|
|
685
|
+
const targets = [
|
|
686
|
+
path.join(home, '.agents', 'skills', 'gm-skill', 'SKILL.md'),
|
|
687
|
+
path.join(home, '.claude', 'skills', 'gm-skill', 'SKILL.md'),
|
|
688
|
+
];
|
|
689
|
+
const refreshed = [];
|
|
690
|
+
for (const target of targets) {
|
|
691
|
+
try {
|
|
692
|
+
let needsWrite = true;
|
|
693
|
+
if (fs.existsSync(target)) {
|
|
694
|
+
const existing = fs.readFileSync(target, 'utf-8');
|
|
695
|
+
const existingHash = crypto.createHash('sha256').update(existing).digest('hex');
|
|
696
|
+
if (existingHash === bundledHash) needsWrite = false;
|
|
697
|
+
}
|
|
698
|
+
if (needsWrite) {
|
|
699
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
700
|
+
const tmp = target + '.tmp';
|
|
701
|
+
fs.writeFileSync(tmp, bundled);
|
|
702
|
+
fs.renameSync(tmp, target);
|
|
703
|
+
refreshed.push(target);
|
|
704
|
+
}
|
|
705
|
+
} catch (e) {
|
|
706
|
+
try {
|
|
707
|
+
obsEvent('bootstrap', 'skill-md.refresh.target-failed', { target, error: e.message });
|
|
708
|
+
} catch (_) {}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
if (refreshed.length > 0) {
|
|
712
|
+
log(`SKILL.md refreshed (sha=${bundledHash.slice(0, 12)}): ${refreshed.length} target(s)`);
|
|
713
|
+
try {
|
|
714
|
+
obsEvent('bootstrap', 'skill-md.refreshed', { hash: bundledHash.slice(0, 12), targets: refreshed, source: bundledPath });
|
|
715
|
+
} catch (_) {}
|
|
716
|
+
}
|
|
717
|
+
return { refreshed, bundledHash, source: bundledPath };
|
|
718
|
+
} catch (e) {
|
|
719
|
+
try { obsEvent('bootstrap', 'skill-md.refresh.failed', { error: e.message }); } catch (_) {}
|
|
720
|
+
return { error: e.message };
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
664
724
|
function installedVersionAtTools() {
|
|
665
725
|
try {
|
|
666
726
|
const p = path.join(gmToolsDir(), 'plugkit.version');
|
|
@@ -704,6 +764,7 @@ async function ensureReady(opts) {
|
|
|
704
764
|
if (isReady() && !versionDrift) {
|
|
705
765
|
const wasmPath = getWasmPath();
|
|
706
766
|
const wrapperUpdated = ensureWrapperFresh();
|
|
767
|
+
ensureSkillMdFresh();
|
|
707
768
|
return { ok: true, wasmPath, binaryPath: wasmPath, status: wrapperUpdated ? 'wrapper-refreshed' : 'already-ready', version: installed };
|
|
708
769
|
}
|
|
709
770
|
if (versionDrift) {
|
|
@@ -720,6 +781,7 @@ async function ensureReady(opts) {
|
|
|
720
781
|
|
|
721
782
|
const wasmPath = await bootstrap();
|
|
722
783
|
ensureWrapperFresh();
|
|
784
|
+
ensureSkillMdFresh();
|
|
723
785
|
return { ok: true, wasmPath, binaryPath: wasmPath, status: 'bootstrapped', version: targetVersion || installed };
|
|
724
786
|
}
|
|
725
787
|
|
package/gm-plugkit/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1329",
|
|
4
4
|
"description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"bootstrap.js",
|
|
14
14
|
"plugkit-wasm-wrapper.js",
|
|
15
15
|
"plugkit.version",
|
|
16
|
-
"plugkit.sha256"
|
|
16
|
+
"plugkit.sha256",
|
|
17
|
+
"SKILL.md"
|
|
17
18
|
],
|
|
18
19
|
"keywords": [
|
|
19
20
|
"gm",
|
package/gm.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1329",
|
|
4
4
|
"description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
|
|
5
5
|
"author": "AnEntrypoint",
|
|
6
6
|
"license": "MIT",
|