gm-skill 2.0.1947 → 2.0.1948
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/supervisor.js +18 -3
- 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.1948",
|
|
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": {
|
package/gm-plugkit/supervisor.js
CHANGED
|
@@ -165,13 +165,28 @@ function readShutdownReason() {
|
|
|
165
165
|
// deliberate upgrade recycle as a SILENT ABORT / unplanned-restart critical. Write
|
|
166
166
|
// the planned reason on the child's behalf BEFORE killing, so the next boot reads a
|
|
167
167
|
// fresh planned shutdown reason and classifies the restart correctly.
|
|
168
|
+
function pidAliveSync(pid) {
|
|
169
|
+
try { process.kill(pid, 0); return true; } catch (_) { return false; }
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function waitForPidDeath(pid, timeoutMs) {
|
|
173
|
+
const deadline = Date.now() + timeoutMs;
|
|
174
|
+
while (Date.now() < deadline) {
|
|
175
|
+
if (!pidAliveSync(pid)) return true;
|
|
176
|
+
try { spawnSync(process.platform === 'win32' ? 'ping' : 'sleep', process.platform === 'win32' ? ['-n', '2', '127.0.0.1'] : ['0.3'], { stdio: 'ignore', windowsHide: true }); } catch (_) {}
|
|
177
|
+
}
|
|
178
|
+
return !pidAliveSync(pid);
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
function killChild(reason) {
|
|
169
182
|
if (!currentChildPid) return;
|
|
170
|
-
|
|
171
|
-
try {
|
|
183
|
+
const pid = currentChildPid;
|
|
184
|
+
try { fs.writeFileSync(SHUTDOWN_REASON_PATH, JSON.stringify({ reason, ts: Date.now(), pid, killed_by_supervisor: true })); } catch (_) {}
|
|
185
|
+
try { process.kill(pid, 'SIGTERM'); } catch (_) {}
|
|
172
186
|
if (process.platform === 'win32') {
|
|
173
|
-
try { spawnSync('taskkill', ['/F', '/T', '/PID', String(
|
|
187
|
+
try { spawnSync('taskkill', ['/F', '/T', '/PID', String(pid)], { stdio: 'ignore', windowsHide: true, timeout: 3000 }); } catch (_) {}
|
|
174
188
|
}
|
|
189
|
+
waitForPidDeath(pid, 5000);
|
|
175
190
|
}
|
|
176
191
|
|
|
177
192
|
let lastSpawnedAt = 0;
|
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.1948",
|
|
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",
|