gm-skill 2.0.1621 → 2.0.1622
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 +17 -22
- 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.1622",
|
|
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": {
|
|
@@ -2277,13 +2277,14 @@ function readInstanceVersion(instance) {
|
|
|
2277
2277
|
const result = fn();
|
|
2278
2278
|
let ptr, len;
|
|
2279
2279
|
if (typeof result === 'bigint') {
|
|
2280
|
-
|
|
2281
|
-
|
|
2280
|
+
const u = BigInt.asUintN(64, result); // normalize the i64 to unsigned before splitting (signed-ptr fix)
|
|
2281
|
+
ptr = Number(u & 0xffffffffn);
|
|
2282
|
+
len = Number(u >> 32n);
|
|
2282
2283
|
} else {
|
|
2283
|
-
ptr = Number(result)
|
|
2284
|
+
ptr = Number(result) >>> 0; // unsigned 32-bit
|
|
2284
2285
|
len = 0;
|
|
2285
2286
|
}
|
|
2286
|
-
const buf = new Uint8Array(instance.exports.memory.buffer, ptr, 64);
|
|
2287
|
+
const buf = new Uint8Array(instance.exports.memory.buffer, ptr, 64); // fresh buffer (post fn() grow)
|
|
2287
2288
|
if (len === 0) {
|
|
2288
2289
|
let end = 0;
|
|
2289
2290
|
while (end < buf.length && buf[end] !== 0) end++;
|
|
@@ -3274,20 +3275,17 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
3274
3275
|
}
|
|
3275
3276
|
}
|
|
3276
3277
|
|
|
3277
|
-
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3280
|
-
new Uint8Array(instance.exports.memory.buffer, bodyPtr, bodyBytes.length).set(bodyBytes);
|
|
3278
|
+
// writeWasmInput re-reads memory.buffer fresh after each alloc (detached-buffer write fix).
|
|
3279
|
+
const verbPtr = writeWasmInput(instance, verbBytes, `spool-dispatch:${verb}.verb`);
|
|
3280
|
+
const bodyPtr = writeWasmInput(instance, bodyBytes, `spool-dispatch:${verb}.body`);
|
|
3281
3281
|
|
|
3282
3282
|
writeVerbActive(verb, taskBase);
|
|
3283
3283
|
const result = dispatch(verbPtr, verbBytes.length, bodyPtr, bodyBytes.length);
|
|
3284
3284
|
clearVerbActive();
|
|
3285
3285
|
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
const resultBytes = new Uint8Array(instance.exports.memory.buffer, ptr, len);
|
|
3290
|
-
let resultStr = new TextDecoder().decode(resultBytes);
|
|
3286
|
+
// decodeWasmResult normalizes the i64 (BigInt.asUintN), re-reads the buffer FRESH (post-grow),
|
|
3287
|
+
// guards the range, AND frees the result ptr -- so the (ptr,len) free below is dropped.
|
|
3288
|
+
let resultStr = decodeWasmResult(instance, result, `spool-dispatch:${verb}`);
|
|
3291
3289
|
|
|
3292
3290
|
if (autoRecallPayload) {
|
|
3293
3291
|
resultStr = mergeAutoRecallIntoInstructionResponse(resultStr, autoRecallPayload);
|
|
@@ -3340,7 +3338,7 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
3340
3338
|
|
|
3341
3339
|
try { instance.exports.plugkit_free(verbPtr, verbBytes.length); } catch (_) {}
|
|
3342
3340
|
try { instance.exports.plugkit_free(bodyPtr, bodyBytes.length); } catch (_) {}
|
|
3343
|
-
|
|
3341
|
+
// (the result ptr is freed inside decodeWasmResult above)
|
|
3344
3342
|
|
|
3345
3343
|
try { if (fs.existsSync(filePath)) fs.unlinkSync(filePath); } catch (_) {}
|
|
3346
3344
|
unmarkProcessed(key);
|
|
@@ -3988,15 +3986,12 @@ if (_isCliEntry) (async () => {
|
|
|
3988
3986
|
const dispatch = instance.exports.dispatch_verb;
|
|
3989
3987
|
const verbBytes = new TextEncoder().encode(verb);
|
|
3990
3988
|
const bodyBytes = new TextEncoder().encode(body);
|
|
3991
|
-
const verbPtr = instance
|
|
3992
|
-
const bodyPtr = instance
|
|
3993
|
-
new Uint8Array(instance.exports.memory.buffer, verbPtr, verbBytes.length).set(verbBytes);
|
|
3994
|
-
new Uint8Array(instance.exports.memory.buffer, bodyPtr, bodyBytes.length).set(bodyBytes);
|
|
3989
|
+
const verbPtr = writeWasmInput(instance, verbBytes, `cli-dispatch:${verb}.verb`);
|
|
3990
|
+
const bodyPtr = writeWasmInput(instance, bodyBytes, `cli-dispatch:${verb}.body`);
|
|
3995
3991
|
const result = dispatch(verbPtr, verbBytes.length, bodyPtr, bodyBytes.length);
|
|
3996
|
-
const
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
const out = new TextDecoder().decode(new Uint8Array(instance.exports.memory.buffer, ptr, len));
|
|
3992
|
+
const out = decodeWasmResult(instance, result, `cli-dispatch:${verb}`); // normalized i64 + fresh buffer
|
|
3993
|
+
try { instance.exports.plugkit_free(verbPtr, verbBytes.length); } catch (_) {}
|
|
3994
|
+
try { instance.exports.plugkit_free(bodyPtr, bodyBytes.length); } catch (_) {}
|
|
4000
3995
|
process.stdout.write(out);
|
|
4001
3996
|
let parsed;
|
|
4002
3997
|
try { parsed = JSON.parse(out); } catch (_) { parsed = null; }
|
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.1622",
|
|
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",
|