gm-skill 2.0.1375 → 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 +62 -20
- 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) {
|
|
@@ -2188,14 +2205,32 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2188
2205
|
if (unsupervised) {
|
|
2189
2206
|
if (_driftLoggedOnce) return;
|
|
2190
2207
|
_driftLoggedOnce = true;
|
|
2191
|
-
logEvent('plugkit', 'version.drift-
|
|
2208
|
+
logEvent('plugkit', 'version.drift-self-respawn', {
|
|
2192
2209
|
instance_version: instV,
|
|
2193
2210
|
file_version: fileV,
|
|
2194
|
-
action: '
|
|
2195
|
-
reason: 'no-supervisor-to-respawn',
|
|
2211
|
+
action: 'spawn-replacement-and-exit',
|
|
2196
2212
|
boot_reason: bootReason,
|
|
2197
2213
|
});
|
|
2198
|
-
console.error(`[plugkit-wasm] version drift detected: instance=${instV} file=${fileV} —
|
|
2214
|
+
console.error(`[plugkit-wasm] version drift detected: instance=${instV} file=${fileV} — spawning replacement via bun x gm-plugkit@latest spool then exiting`);
|
|
2215
|
+
try {
|
|
2216
|
+
const cp = require('child_process');
|
|
2217
|
+
const bunPath = process.env.GM_BUN_PATH || 'bun';
|
|
2218
|
+
const child = cp.spawn(bunPath, ['x', 'gm-plugkit@latest', 'spool'], {
|
|
2219
|
+
cwd: process.cwd(),
|
|
2220
|
+
detached: true,
|
|
2221
|
+
stdio: 'ignore',
|
|
2222
|
+
windowsHide: true,
|
|
2223
|
+
env: { ...process.env, PLUGKIT_BOOT_REASON: 'self-respawn-from-drift' },
|
|
2224
|
+
});
|
|
2225
|
+
child.unref();
|
|
2226
|
+
} catch (e) {
|
|
2227
|
+
console.error(`[plugkit-wasm] failed to spawn replacement: ${e.message}; exiting anyway so next agent dispatch boots fresh`);
|
|
2228
|
+
}
|
|
2229
|
+
try { fs.writeFileSync(path.join(spoolDir, '.shutdown-reason.json'), JSON.stringify({ reason: 'version-change-unsupervised', ts: Date.now(), pid: process.pid, instance_version: instV, file_version: fileV })); } catch (_) {}
|
|
2230
|
+
try { releaseLock(); } catch (_) {}
|
|
2231
|
+
try { fs.unlinkSync(STATUS_PATH_FOR_TEARDOWN); } catch (_) {}
|
|
2232
|
+
try { clearBootActive(); } catch (_) {}
|
|
2233
|
+
setTimeout(() => process.exit(0), 2000);
|
|
2199
2234
|
return;
|
|
2200
2235
|
}
|
|
2201
2236
|
logEvent('plugkit', 'version.drift', {
|
|
@@ -2240,25 +2275,32 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2240
2275
|
if (unsupervised) {
|
|
2241
2276
|
if (_wrapperDriftLoggedOnce) return;
|
|
2242
2277
|
_wrapperDriftLoggedOnce = true;
|
|
2243
|
-
|
|
2244
|
-
const marker = {
|
|
2245
|
-
ts: new Date().toISOString(),
|
|
2246
|
-
reason: 'wrapper-has-newer-on-disk',
|
|
2247
|
-
running_sha12: _wrapperShaAtBoot.slice(0, 12),
|
|
2248
|
-
disk_sha12: cur.slice(0, 12),
|
|
2249
|
-
running_pid: process.pid,
|
|
2250
|
-
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.',
|
|
2251
|
-
};
|
|
2252
|
-
fs.writeFileSync(path.join(spoolDir, '.wrapper-stale-in-memory.json'), JSON.stringify(marker, null, 2));
|
|
2253
|
-
} catch (_) {}
|
|
2254
|
-
logEvent('plugkit', 'wrapper.drift-detected-no-exit', {
|
|
2278
|
+
logEvent('plugkit', 'wrapper.drift-self-respawn', {
|
|
2255
2279
|
boot_sha: _wrapperShaAtBoot.slice(0, 12),
|
|
2256
2280
|
file_sha: cur.slice(0, 12),
|
|
2257
|
-
action: '
|
|
2258
|
-
reason: 'no-supervisor-to-respawn',
|
|
2281
|
+
action: 'spawn-replacement-and-exit',
|
|
2259
2282
|
boot_reason: bootReason,
|
|
2260
2283
|
});
|
|
2261
|
-
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);
|
|
2262
2304
|
return;
|
|
2263
2305
|
}
|
|
2264
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",
|