gm-skill 2.0.1407 → 2.0.1408
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 +35 -1
- 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.1408",
|
|
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": {
|
|
@@ -2862,6 +2862,7 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2862
2862
|
const UPDATE_CHECK_SHARED_CACHE = path.join(GM_TOOLS_ROOT, '.update-check-cache.json');
|
|
2863
2863
|
const UPDATE_CHECK_CACHE_TTL_MS = 4 * 60 * 1000;
|
|
2864
2864
|
let _lastKnownDrift = null;
|
|
2865
|
+
let _autoUpdateArmedFor = null;
|
|
2865
2866
|
function readSharedUpdateCache() {
|
|
2866
2867
|
try {
|
|
2867
2868
|
const content = fs.readFileSync(UPDATE_CHECK_SHARED_CACHE, 'utf-8');
|
|
@@ -2963,6 +2964,18 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2963
2964
|
logEvent('plugkit', 'update.available', { installed, latest });
|
|
2964
2965
|
_lastKnownDrift = latest;
|
|
2965
2966
|
}
|
|
2967
|
+
// Auto-update from the shared-cache path too, so any watcher (not only the one that hit the
|
|
2968
|
+
// network) arms the self-respawn. The cache entry is only written after a 200 from
|
|
2969
|
+
// /releases/latest, and the respawn's ensureReady re-verifies the wasm asset before downloading,
|
|
2970
|
+
// so a bump here is safe even without per-asset confirmation in this branch.
|
|
2971
|
+
if (isDrift && _autoUpdateArmedFor !== latest) {
|
|
2972
|
+
try {
|
|
2973
|
+
_autoUpdateArmedFor = latest;
|
|
2974
|
+
const verFile = path.join(GM_TOOLS_ROOT, 'plugkit.version');
|
|
2975
|
+
fs.writeFileSync(verFile, latest + '\n');
|
|
2976
|
+
logEvent('plugkit', 'update.auto-armed', { installed, latest, source: 'shared-cache', action: 'bumped-version-file-for-drift-respawn' });
|
|
2977
|
+
} catch (_) {}
|
|
2978
|
+
}
|
|
2966
2979
|
}
|
|
2967
2980
|
function checkForUpdate() {
|
|
2968
2981
|
const installed = resolveVersion(instance);
|
|
@@ -3005,7 +3018,7 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
3005
3018
|
installed,
|
|
3006
3019
|
latest,
|
|
3007
3020
|
checked_at_ms: Date.now(),
|
|
3008
|
-
instruction: 'plugkit is out of date.
|
|
3021
|
+
instruction: 'plugkit is out of date. The watcher auto-updates: on the next drift-check tick it bumps the disk version file and self-respawns into the fresh wasm. No manual action needed.',
|
|
3009
3022
|
update_url,
|
|
3010
3023
|
}, null, 2));
|
|
3011
3024
|
console.log(`[update] available: installed=${installed} latest=${latest} → wrote ${UPDATE_AVAILABLE_PATH}`);
|
|
@@ -3013,6 +3026,27 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
3013
3026
|
logEvent('plugkit', 'update.available', { installed, latest, update_url });
|
|
3014
3027
|
_lastKnownDrift = latest;
|
|
3015
3028
|
}
|
|
3029
|
+
// Auto-update: a running healthy watcher otherwise never self-updates — checkForUpdate
|
|
3030
|
+
// only NOTIFIED, and the version-drift self-respawn compares instance-vs-disk-file, but
|
|
3031
|
+
// the disk file only moved on a fresh boot that never ran while the watcher held the lock.
|
|
3032
|
+
// Close the loop: once the release is fully published (wasm asset present, confirmed by
|
|
3033
|
+
// this /releases/latest response carrying it), bump the disk version file to `latest`.
|
|
3034
|
+
// The existing drift-check tick then sees instance != file and self-respawns; the respawn's
|
|
3035
|
+
// ensureReady downloads the wasm matching the bumped version file. Guard against partial
|
|
3036
|
+
// releases and respawn thrash: require the wasm asset, and write the file at most once per
|
|
3037
|
+
// detected version (dedupe via _autoUpdateArmedFor).
|
|
3038
|
+
try {
|
|
3039
|
+
const hasWasmAsset = Array.isArray(rel.assets) && rel.assets.some(a => a && a.name === 'plugkit.wasm');
|
|
3040
|
+
if (hasWasmAsset && latest !== installed && _autoUpdateArmedFor !== latest) {
|
|
3041
|
+
_autoUpdateArmedFor = latest;
|
|
3042
|
+
const verFile = path.join(GM_TOOLS_ROOT, 'plugkit.version');
|
|
3043
|
+
fs.writeFileSync(verFile, latest + '\n');
|
|
3044
|
+
logEvent('plugkit', 'update.auto-armed', { installed, latest, action: 'bumped-version-file-for-drift-respawn' });
|
|
3045
|
+
console.log(`[update] auto-armed: bumped ${verFile} ${installed} -> ${latest}; drift-check will self-respawn into fresh wasm`);
|
|
3046
|
+
}
|
|
3047
|
+
} catch (e) {
|
|
3048
|
+
logUpdateCheckError({ error: `auto-arm failed: ${String(e && e.message || e)}` });
|
|
3049
|
+
}
|
|
3016
3050
|
} catch (e) {
|
|
3017
3051
|
logUpdateCheckError({ error: String(e && e.message || e) });
|
|
3018
3052
|
}
|
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.1408",
|
|
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",
|