gm-plugkit 2.0.1483 → 2.0.1484

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1483",
3
+ "version": "2.0.1484",
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": {
@@ -2876,18 +2876,24 @@ async function runSpoolWatcher(instance, spoolDir) {
2876
2876
  }
2877
2877
  };
2878
2878
 
2879
- function walkDir(dir) {
2879
+ function walkDir(dir, depth = 0) {
2880
2880
  const files = [];
2881
2881
  try {
2882
2882
  for (const entry of fs.readdirSync(dir)) {
2883
2883
  if (/\.tmp\.\d+(\.|$)/.test(entry)) continue;
2884
+ // The verb tree is in/<verb>/[<sub>/]<N>.<ext> — at most two levels deep. A
2885
+ // dot-prefixed dir (e.g. a stray nested .gm/exec-spool/ created by a misfire)
2886
+ // is never a verb dir; recursing into it derives a bogus verb like
2887
+ // `prd-resolve\.gm\exec-spool` and dispatch-errors on every tick forever.
2888
+ // Skip dot-dirs and cap depth so a spool-inside-spool cannot wedge the watcher.
2889
+ if (entry.startsWith('.')) continue;
2884
2890
  const fullPath = path.join(dir, entry);
2885
2891
  let stat;
2886
2892
  try { stat = fs.statSync(fullPath); } catch (_) { continue; }
2887
2893
  if (stat.isFile()) {
2888
2894
  files.push(fullPath);
2889
- } else if (stat.isDirectory()) {
2890
- files.push(...walkDir(fullPath));
2895
+ } else if (stat.isDirectory() && depth < 2) {
2896
+ files.push(...walkDir(fullPath, depth + 1));
2891
2897
  }
2892
2898
  }
2893
2899
  } catch (e) {
@@ -3329,6 +3335,10 @@ async function runSpoolWatcher(instance, spoolDir) {
3329
3335
  watch(inDir, { recursive: true }, (eventType, filename) => {
3330
3336
  if (!filename) return;
3331
3337
  if (/\.tmp\.\d+(\.|$)/.test(filename)) return;
3338
+ // Skip any path with a dot-prefixed segment (e.g. a stray nested
3339
+ // prd-resolve/.gm/exec-spool/…): it is not a real verb dispatch and walking it
3340
+ // derives a bogus verb that dispatch-errors on every tick. Matches walkDir's guard.
3341
+ if (filename.split(/[\\/]/).some(seg => seg.startsWith('.'))) return;
3332
3342
  const fullPath = path.join(inDir, filename);
3333
3343
  markActivity('watch');
3334
3344