gm-skill 2.0.1376 → 2.0.1377
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/gm-plugkit/package.json +1 -1
- package/gm-plugkit/plugkit-wasm-wrapper.js +40 -16
- package/gm.json +1 -1
- package/package.json +1 -1
package/gm-plugkit/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1377",
|
|
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": {
|
|
@@ -2144,7 +2144,24 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2144
2144
|
if (!_selfStaleLoggedOnce) {
|
|
2145
2145
|
_selfStaleLoggedOnce = true;
|
|
2146
2146
|
try { logEvent('plugkit', 'gm-plugkit.self-stale', { running_version: own, latest_version: latest, detected_by: 'watcher-periodic-probe' }); } catch (_) {}
|
|
2147
|
-
console.error(`[plugkit-wasm] gm-plugkit self-stale: running ${own}, latest npm ${latest}
|
|
2147
|
+
console.error(`[plugkit-wasm] gm-plugkit self-stale: running ${own}, latest npm ${latest} → spawning replacement via bun x gm-plugkit@latest spool and exiting`);
|
|
2148
|
+
try {
|
|
2149
|
+
const cp = require('child_process');
|
|
2150
|
+
const bunPath = process.env.GM_BUN_PATH || 'bun';
|
|
2151
|
+
const child = cp.spawn(bunPath, ['x', `gm-plugkit@${latest}`, 'spool'], {
|
|
2152
|
+
cwd: process.cwd(),
|
|
2153
|
+
detached: true,
|
|
2154
|
+
stdio: 'ignore',
|
|
2155
|
+
windowsHide: true,
|
|
2156
|
+
env: { ...process.env, PLUGKIT_BOOT_REASON: 'self-respawn-from-self-stale' },
|
|
2157
|
+
});
|
|
2158
|
+
child.unref();
|
|
2159
|
+
try { logEvent('plugkit', 'gm-plugkit.self-stale-respawn', { running_version: own, latest_version: latest }); } catch (_) {}
|
|
2160
|
+
try { fs.writeFileSync(path.join(spoolDir, '.shutdown-reason.json'), JSON.stringify({ reason: 'gm-plugkit-self-stale', ts: Date.now(), pid: process.pid, running_version: own, latest_version: latest })); } catch (_) {}
|
|
2161
|
+
setTimeout(() => process.exit(0), 2000);
|
|
2162
|
+
} catch (e) {
|
|
2163
|
+
console.error(`[plugkit-wasm] failed to spawn replacement on self-stale: ${e.message}`);
|
|
2164
|
+
}
|
|
2148
2165
|
}
|
|
2149
2166
|
} catch (e) {
|
|
2150
2167
|
if (!_selfStaleProbeErrorLogged) {
|
|
@@ -2258,25 +2275,32 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2258
2275
|
if (unsupervised) {
|
|
2259
2276
|
if (_wrapperDriftLoggedOnce) return;
|
|
2260
2277
|
_wrapperDriftLoggedOnce = true;
|
|
2261
|
-
|
|
2262
|
-
const marker = {
|
|
2263
|
-
ts: new Date().toISOString(),
|
|
2264
|
-
reason: 'wrapper-has-newer-on-disk',
|
|
2265
|
-
running_sha12: _wrapperShaAtBoot.slice(0, 12),
|
|
2266
|
-
disk_sha12: cur.slice(0, 12),
|
|
2267
|
-
running_pid: process.pid,
|
|
2268
|
-
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.',
|
|
2269
|
-
};
|
|
2270
|
-
fs.writeFileSync(path.join(spoolDir, '.wrapper-stale-in-memory.json'), JSON.stringify(marker, null, 2));
|
|
2271
|
-
} catch (_) {}
|
|
2272
|
-
logEvent('plugkit', 'wrapper.drift-detected-no-exit', {
|
|
2278
|
+
logEvent('plugkit', 'wrapper.drift-self-respawn', {
|
|
2273
2279
|
boot_sha: _wrapperShaAtBoot.slice(0, 12),
|
|
2274
2280
|
file_sha: cur.slice(0, 12),
|
|
2275
|
-
action: '
|
|
2276
|
-
reason: 'no-supervisor-to-respawn',
|
|
2281
|
+
action: 'spawn-replacement-and-exit',
|
|
2277
2282
|
boot_reason: bootReason,
|
|
2278
2283
|
});
|
|
2279
|
-
console.error(`[plugkit-wasm] wrapper.js drift detected —
|
|
2284
|
+
console.error(`[plugkit-wasm] wrapper.js drift detected — spawning replacement via bun x gm-plugkit@latest spool then exiting`);
|
|
2285
|
+
try {
|
|
2286
|
+
const cp = require('child_process');
|
|
2287
|
+
const bunPath = process.env.GM_BUN_PATH || 'bun';
|
|
2288
|
+
const child = cp.spawn(bunPath, ['x', 'gm-plugkit@latest', 'spool'], {
|
|
2289
|
+
cwd: process.cwd(),
|
|
2290
|
+
detached: true,
|
|
2291
|
+
stdio: 'ignore',
|
|
2292
|
+
windowsHide: true,
|
|
2293
|
+
env: { ...process.env, PLUGKIT_BOOT_REASON: 'self-respawn-from-wrapper-drift' },
|
|
2294
|
+
});
|
|
2295
|
+
child.unref();
|
|
2296
|
+
} catch (e) {
|
|
2297
|
+
console.error(`[plugkit-wasm] failed to spawn replacement: ${e.message}`);
|
|
2298
|
+
}
|
|
2299
|
+
try { fs.writeFileSync(path.join(spoolDir, '.shutdown-reason.json'), JSON.stringify({ reason: 'wrapper-drift-unsupervised', ts: Date.now(), pid: process.pid, boot_sha: _wrapperShaAtBoot.slice(0, 12), file_sha: cur.slice(0, 12) })); } catch (_) {}
|
|
2300
|
+
try { releaseLock(); } catch (_) {}
|
|
2301
|
+
try { fs.unlinkSync(STATUS_PATH_FOR_TEARDOWN); } catch (_) {}
|
|
2302
|
+
try { clearBootActive(); } catch (_) {}
|
|
2303
|
+
setTimeout(() => process.exit(0), 2000);
|
|
2280
2304
|
return;
|
|
2281
2305
|
}
|
|
2282
2306
|
logEvent('plugkit', 'wrapper.drift', {
|
package/gm.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1377",
|
|
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",
|