gm-plugkit 2.0.1261 → 2.0.1263
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 +1 -1
- package/plugkit-wasm-wrapper.js +29 -0
- package/plugkit.sha256 +1 -1
- package/plugkit.version +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1263",
|
|
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/plugkit-wasm-wrapper.js
CHANGED
|
@@ -27,6 +27,35 @@ const ORCHESTRATOR_VERBS = new Set(['instruction', 'transition', 'phase-status',
|
|
|
27
27
|
const TURN_IDLE_MS = 30_000;
|
|
28
28
|
const _turns = new Map();
|
|
29
29
|
|
|
30
|
+
function emitShutdownReason(reason, err) {
|
|
31
|
+
try {
|
|
32
|
+
const spoolDir = process.env.CLAUDE_PROJECT_DIR
|
|
33
|
+
? path.join(process.env.CLAUDE_PROJECT_DIR, '.gm', 'exec-spool')
|
|
34
|
+
: path.join(process.cwd(), '.gm', 'exec-spool');
|
|
35
|
+
fs.mkdirSync(spoolDir, { recursive: true });
|
|
36
|
+
const body = {
|
|
37
|
+
reason,
|
|
38
|
+
ts: Date.now(),
|
|
39
|
+
pid: process.pid,
|
|
40
|
+
message: err && (err.message || String(err)),
|
|
41
|
+
stack: err && err.stack ? String(err.stack).slice(0, 4000) : null,
|
|
42
|
+
version: typeof PLUGKIT_VERSION !== 'undefined' ? PLUGKIT_VERSION : null,
|
|
43
|
+
};
|
|
44
|
+
fs.writeFileSync(path.join(spoolDir, '.shutdown-reason.json'), JSON.stringify(body, null, 2));
|
|
45
|
+
} catch (_) {}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
process.on('uncaughtException', (err) => {
|
|
49
|
+
try { console.error('[plugkit-wasm] uncaught:', err && err.stack || err); } catch (_) {}
|
|
50
|
+
emitShutdownReason('uncaughtException', err);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
process.on('unhandledRejection', (reason) => {
|
|
55
|
+
try { console.error('[plugkit-wasm] unhandled rejection:', reason && reason.stack || reason); } catch (_) {}
|
|
56
|
+
emitShutdownReason('unhandledRejection', reason instanceof Error ? reason : new Error(String(reason)));
|
|
57
|
+
process.exit(1);
|
|
58
|
+
});
|
|
30
59
|
|
|
31
60
|
function applyDisciplineSigil(rawBody) {
|
|
32
61
|
let parsed;
|
package/plugkit.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"plugkit.wasm":"
|
|
1
|
+
{"plugkit.wasm":"21a0c7b54788cec3dc35cbc00c4847ced155a2c8336b0c01d0987d2cc2247f06"}
|
package/plugkit.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.467
|