gm-plugkit 2.0.1827 → 2.0.1829

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.
Files changed (2) hide show
  1. package/bootstrap.js +30 -13
  2. package/package.json +2 -3
package/bootstrap.js CHANGED
@@ -774,7 +774,32 @@ function ensureGmPlugkitVersionFresh() {
774
774
  } catch (_) { return false; }
775
775
  }
776
776
 
777
- const BOOTSTRAP_JS_BUNDLED_SKILLS = ['gm', 'gm-continue', 'wfgy-method'];
777
+ function discoverBundledSkillsAndSources() {
778
+ const found = new Map();
779
+ found.set('gm', path.join(__dirname, 'SKILL.md'));
780
+ try {
781
+ for (const f of fs.readdirSync(__dirname)) {
782
+ const m = f.match(/^SKILL-(.+)\.md$/);
783
+ if (m) found.set(m[1], path.join(__dirname, f));
784
+ }
785
+ } catch (_) {}
786
+ const devSkillsRoots = [
787
+ path.join(__dirname, '..', 'gm-skill', 'skills'),
788
+ path.join(__dirname, '..', '..', 'gm-skill', 'skills'),
789
+ path.join(__dirname, '..', 'skills'),
790
+ ];
791
+ for (const root of devSkillsRoots) {
792
+ try {
793
+ if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) continue;
794
+ for (const e of fs.readdirSync(root, { withFileTypes: true })) {
795
+ if (!e.isDirectory()) continue;
796
+ const p = path.join(root, e.name, 'SKILL.md');
797
+ if (fs.existsSync(p) && !found.has(e.name)) found.set(e.name, p);
798
+ }
799
+ } catch (_) {}
800
+ }
801
+ return found;
802
+ }
778
803
 
779
804
  function ensureSkillMdFresh() {
780
805
  const home = process.env.HOME || process.env.USERPROFILE || require('os').homedir();
@@ -782,19 +807,11 @@ function ensureSkillMdFresh() {
782
807
  const _norm = s => s.replace(/\r\n/g, '\n');
783
808
  const allRefreshed = [];
784
809
  const sources = {};
785
- for (const skillName of BOOTSTRAP_JS_BUNDLED_SKILLS) {
810
+ const discovered = discoverBundledSkillsAndSources();
811
+ for (const [skillName, bundledPath] of discovered) {
786
812
  try {
787
- const candidates = [
788
- path.join(__dirname, skillName === 'gm' ? 'SKILL.md' : `SKILL-${skillName}.md`),
789
- path.join(__dirname, '..', 'gm-skill', 'skills', skillName, 'SKILL.md'),
790
- path.join(__dirname, '..', '..', 'gm-skill', 'skills', skillName, 'SKILL.md'),
791
- path.join(__dirname, '..', 'skills', skillName, 'SKILL.md'),
792
- ];
793
- const bundledPath = candidates.find(p => {
794
- try { return fs.existsSync(p); } catch (_) { return false; }
795
- });
796
- if (!bundledPath) {
797
- try { obsEvent('bootstrap', 'skill-md.refresh.bundled-not-found', { skillName, searched: candidates }); } catch (_) {}
813
+ if (!fs.existsSync(bundledPath)) {
814
+ try { obsEvent('bootstrap', 'skill-md.refresh.bundled-not-found', { skillName, searched: [bundledPath] }); } catch (_) {}
798
815
  continue;
799
816
  }
800
817
  const bundled = fs.readFileSync(bundledPath, 'utf-8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1827",
3
+ "version": "2.0.1829",
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": {
@@ -17,8 +17,7 @@
17
17
  "plugkit.version",
18
18
  "plugkit.sha256",
19
19
  "SKILL.md",
20
- "SKILL-gm-continue.md",
21
- "SKILL-wfgy-method.md",
20
+ "SKILL-*.md",
22
21
  "instructions/"
23
22
  ],
24
23
  "keywords": [