gm-skill 2.0.1348 → 2.0.1349

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.
@@ -746,9 +746,61 @@ async function resolveLatestRemoteVersion(timeoutMs) {
746
746
  return null;
747
747
  }
748
748
 
749
+ async function resolveLatestGmPlugkitNpmVersion(timeoutMs) {
750
+ try {
751
+ const buf = await httpGetBuffer('https://registry.npmjs.org/gm-plugkit/latest', timeoutMs || 3000);
752
+ const meta = JSON.parse(buf.toString('utf-8'));
753
+ if (meta && typeof meta.version === 'string') return meta.version;
754
+ } catch (_) {}
755
+ return null;
756
+ }
757
+
758
+ function getSelfVersion() {
759
+ try {
760
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'));
761
+ return pkg.version || null;
762
+ } catch (_) { return null; }
763
+ }
764
+
765
+ async function probeSelfStaleness(timeoutMs) {
766
+ const own = getSelfVersion();
767
+ if (!own) return { stale: false, reason: 'no-self-version' };
768
+ const latest = await resolveLatestGmPlugkitNpmVersion(timeoutMs);
769
+ if (!latest) return { stale: false, reason: 'no-remote-version', own };
770
+ if (latest === own) return { stale: false, own, latest };
771
+ return { stale: true, own, latest };
772
+ }
773
+
749
774
  async function ensureReady(opts) {
750
775
  opts = opts || {};
751
776
  const offline = opts.offline === true;
777
+
778
+ if (!offline) {
779
+ try {
780
+ const selfStale = await probeSelfStaleness(2500);
781
+ if (selfStale && selfStale.stale) {
782
+ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
783
+ const spoolDir = path.join(projectDir, '.gm', 'exec-spool');
784
+ try { fs.mkdirSync(spoolDir, { recursive: true }); } catch (_) {}
785
+ const marker = {
786
+ ts: new Date().toISOString(),
787
+ reason: 'gm-plugkit-self-stale',
788
+ running_version: selfStale.own,
789
+ latest_version: selfStale.latest,
790
+ instruction: `gm-plugkit running ${selfStale.own} but npm has ${selfStale.latest}. The npx/bun cache served a stale copy. Clear the cache so the next invocation picks up the latest wrapper fixes: bun pm cache rm; or npx clear-npx-cache; or rm -rf ~/.npm/_npx ~/AppData/Local/npm-cache/_npx`,
791
+ };
792
+ try { fs.writeFileSync(path.join(spoolDir, '.gm-plugkit-stale.json'), JSON.stringify(marker, null, 2)); } catch (_) {}
793
+ log(`gm-plugkit self-stale: running ${selfStale.own}, latest npm ${selfStale.latest} — cache served old code (marker at .gm/exec-spool/.gm-plugkit-stale.json)`);
794
+ } else if (selfStale && selfStale.own) {
795
+ try {
796
+ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
797
+ const stalePath = path.join(projectDir, '.gm', 'exec-spool', '.gm-plugkit-stale.json');
798
+ if (fs.existsSync(stalePath)) fs.unlinkSync(stalePath);
799
+ } catch (_) {}
800
+ }
801
+ } catch (_) {}
802
+ }
803
+
752
804
  let pinnedVersion = null;
753
805
  try { pinnedVersion = readVersionFile(); } catch (_) {}
754
806
  let targetVersion = pinnedVersion;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1348",
3
+ "version": "2.0.1349",
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": {
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1348",
3
+ "version": "2.0.1349",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1348",
3
+ "version": "2.0.1349",
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",