gm-plugkit 2.0.1178 → 2.0.1180

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.1178",
3
+ "version": "2.0.1180",
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": {
@@ -1008,6 +1008,15 @@ async function runSpoolWatcher(instance, spoolDir) {
1008
1008
  if (_ownWrapperSha12 && holderSha && holderSha !== _ownWrapperSha12) {
1009
1009
  try { logEvent('plugkit', 'peer.stale-wrapper-takeover', { holder_pid: pidStr, holder_sha: holderSha, own_sha: _ownWrapperSha12, lock_age_ms: age }); } catch (_) {}
1010
1010
  console.error(`[plugkit-wasm] peer wrapper-sha mismatch (holder=${holderSha} own=${_ownWrapperSha12}); killing pid=${pidStr} and taking over`);
1011
+ try {
1012
+ fs.writeFileSync(path.join(spoolDir, '.shutdown-reason.json'), JSON.stringify({
1013
+ reason: 'peer-stale-takeover',
1014
+ ts: Date.now(),
1015
+ taker_pid: process.pid,
1016
+ taker_sha: _ownWrapperSha12,
1017
+ holder_sha: holderSha,
1018
+ }));
1019
+ } catch (_) {}
1011
1020
  try { process.kill(parseInt(pidStr, 10), 'SIGTERM'); } catch (_) {}
1012
1021
  } else {
1013
1022
  const msg = JSON.stringify({ ok: false, reason: 'another-watcher-active', pid: pidStr, age_ms: age });
@@ -1073,6 +1082,15 @@ async function runSpoolWatcher(instance, spoolDir) {
1073
1082
  } catch (_) { continue; }
1074
1083
  logEvent('plugkit', 'peer.stale-wrapper-killed', { peer_cwd: peerCwd, peer_pid: peerPid, peer_sha: peerSha, own_sha: _ownWrapperSha12, lock_age_ms: age });
1075
1084
  console.error(`[plugkit-wasm] peer-sweep killing stale-wrapper watcher pid=${peerPid} cwd=${peerCwd} sha=${peerSha} (own=${_ownWrapperSha12})`);
1085
+ try {
1086
+ fs.writeFileSync(path.join(peerCwd, '.gm', 'exec-spool', '.shutdown-reason.json'), JSON.stringify({
1087
+ reason: 'peer-stale-takeover',
1088
+ ts: Date.now(),
1089
+ killer_pid: process.pid,
1090
+ killer_sha: _ownWrapperSha12,
1091
+ peer_sha: peerSha,
1092
+ }));
1093
+ } catch (_) {}
1076
1094
  try { process.kill(peerPid, 'SIGTERM'); } catch (_) {}
1077
1095
  }
1078
1096
  }
package/plugkit.sha256 CHANGED
@@ -1 +1 @@
1
- {"plugkit.wasm":"6e4d5f1dd88d74e7adf2058e4668a42548a74452a14c33e6561838c8bf9acbef"}
1
+ {"plugkit.wasm":"9dd65bfeb7037f9d883a3064d22fab4a34581e8fde962aa8dfe20141fbb2dd1c"}
package/plugkit.version CHANGED
@@ -1 +1 @@
1
- 0.1.425
1
+ 0.1.426