gm-skill 2.0.1358 → 2.0.1360

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.
@@ -81,7 +81,8 @@ return JSON.stringify(result);
81
81
  `);
82
82
 
83
83
  const script = fs.readFileSync(witness, 'utf8');
84
- const relayUrl = 'http://127.0.0.1:19988/cli/execute';
84
+ const relayPort = Number(process.env.PLAYWRITER_PORT) || 19988;
85
+ const relayUrl = `http://127.0.0.1:${relayPort}/cli/execute`;
85
86
  const response = await fetch(relayUrl, {
86
87
  method: 'POST',
87
88
  headers: { 'Content-Type': 'application/json' },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1358",
3
+ "version": "2.0.1360",
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": {
@@ -2171,6 +2171,17 @@ async function runSpoolWatcher(instance, spoolDir) {
2171
2171
  if (unsupervised) {
2172
2172
  if (_wrapperDriftLoggedOnce) return;
2173
2173
  _wrapperDriftLoggedOnce = true;
2174
+ try {
2175
+ const marker = {
2176
+ ts: new Date().toISOString(),
2177
+ reason: 'wrapper-has-newer-on-disk',
2178
+ running_sha12: _wrapperShaAtBoot.slice(0, 12),
2179
+ disk_sha12: cur.slice(0, 12),
2180
+ running_pid: process.pid,
2181
+ instruction: 'Wrapper code on disk has newer sha than what this watcher loaded in-memory. Drift-suppress kept the watcher alive (good), but new code only loads on restart. Kill this watcher (taskkill /F /PID ' + process.pid + ' on Windows, kill ' + process.pid + ' on POSIX) and re-bootstrap (bun x gm-plugkit@latest spool) to pick up the new wrapper.',
2182
+ };
2183
+ fs.writeFileSync(path.join(spoolDir, '.wrapper-stale-in-memory.json'), JSON.stringify(marker, null, 2));
2184
+ } catch (_) {}
2174
2185
  logEvent('plugkit', 'wrapper.drift-detected-no-exit', {
2175
2186
  boot_sha: _wrapperShaAtBoot.slice(0, 12),
2176
2187
  file_sha: cur.slice(0, 12),
@@ -2639,12 +2650,56 @@ async function runSpoolWatcher(instance, spoolDir) {
2639
2650
  fs.renameSync(tmp, UPDATE_CHECK_SHARED_CACHE);
2640
2651
  } catch (_) {}
2641
2652
  }
2653
+ const UPDATE_CHECK_ERROR_MARKER = path.join(GM_TOOLS_ROOT, '.update-check-error.json');
2654
+ let _lastKnownUpdateError = null;
2655
+ function readSharedUpdateErrorKey() {
2656
+ try {
2657
+ const raw = fs.readFileSync(UPDATE_CHECK_ERROR_MARKER, 'utf-8');
2658
+ const parsed = JSON.parse(raw);
2659
+ if (parsed && typeof parsed.key === 'string' && Date.now() - (parsed.ts || 0) < 60 * 60 * 1000) {
2660
+ return parsed.key;
2661
+ }
2662
+ } catch (_) {}
2663
+ return null;
2664
+ }
2665
+ function writeSharedUpdateErrorKey(key) {
2666
+ try {
2667
+ const tmp = UPDATE_CHECK_ERROR_MARKER + '.tmp';
2668
+ fs.writeFileSync(tmp, JSON.stringify({ ts: Date.now(), key, by_pid: process.pid }));
2669
+ fs.renameSync(tmp, UPDATE_CHECK_ERROR_MARKER);
2670
+ } catch (_) {}
2671
+ }
2672
+ function clearSharedUpdateErrorKey() {
2673
+ try { fs.unlinkSync(UPDATE_CHECK_ERROR_MARKER); } catch (_) {}
2674
+ }
2675
+ function logUpdateCheckError(fields) {
2676
+ const key = `${fields.status || ''}:${fields.error || ''}`;
2677
+ if (_lastKnownUpdateError === key) return;
2678
+ const shared = readSharedUpdateErrorKey();
2679
+ if (shared === key) {
2680
+ _lastKnownUpdateError = key;
2681
+ return;
2682
+ }
2683
+ _lastKnownUpdateError = key;
2684
+ writeSharedUpdateErrorKey(key);
2685
+ logEvent('plugkit', 'update.check.error', fields);
2686
+ }
2687
+ function clearUpdateCheckError(installed) {
2688
+ const shared = readSharedUpdateErrorKey();
2689
+ if (_lastKnownUpdateError !== null || shared !== null) {
2690
+ const was = _lastKnownUpdateError || shared;
2691
+ logEvent('plugkit', 'update.check.recovered', { installed, was });
2692
+ _lastKnownUpdateError = null;
2693
+ clearSharedUpdateErrorKey();
2694
+ }
2695
+ }
2642
2696
  function applyUpdateCheckResult(installed, latest, statusCode) {
2643
2697
  if (statusCode !== 200) {
2644
- logEvent('plugkit', 'update.check.error', { installed, status: statusCode });
2698
+ logUpdateCheckError({ installed, status: statusCode });
2645
2699
  return;
2646
2700
  }
2647
2701
  if (!latest) return;
2702
+ clearUpdateCheckError(installed);
2648
2703
  if (latest === installed) {
2649
2704
  try { fs.unlinkSync(UPDATE_AVAILABLE_PATH); } catch (_) {}
2650
2705
  if (_lastKnownDrift) {
@@ -2715,18 +2770,18 @@ async function runSpoolWatcher(instance, spoolDir) {
2715
2770
  _lastKnownDrift = latest;
2716
2771
  }
2717
2772
  } catch (e) {
2718
- logEvent('plugkit', 'update.check.error', { error: String(e && e.message || e) });
2773
+ logUpdateCheckError({ error: String(e && e.message || e) });
2719
2774
  }
2720
2775
  });
2721
2776
  });
2722
2777
  req.on('timeout', () => {
2723
2778
  req.destroy();
2724
2779
  writeSharedUpdateCache(null, -1);
2725
- logEvent('plugkit', 'update.check.error', { error: 'timeout' });
2780
+ logUpdateCheckError({ error: 'timeout' });
2726
2781
  });
2727
2782
  req.on('error', (e) => {
2728
2783
  writeSharedUpdateCache(null, -2);
2729
- logEvent('plugkit', 'update.check.error', { error: String(e && e.message || e) });
2784
+ logUpdateCheckError({ error: String(e && e.message || e) });
2730
2785
  });
2731
2786
  }
2732
2787
  setTimeout(checkForUpdate, 10_000);
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1358",
3
+ "version": "2.0.1360",
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.1358",
3
+ "version": "2.0.1360",
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",