gm-skill 2.0.1599 → 2.0.1601

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.
@@ -1 +1 @@
1
- 0.1.680
1
+ 0.1.681
@@ -1 +1 @@
1
- a5e0eb75b126f7596b2aefde80a912c1fa003ded37bf398308eaf1e6226eb338 plugkit.wasm
1
+ 69cc8f062da496978b9e57d72e9b5f45e8e771c5a7e6d2dc95d4e6d200abdbe4 plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1599",
3
+ "version": "2.0.1601",
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": {
@@ -171,7 +171,9 @@ function dispatchVerbToWasmInternal(instance, verb, body) {
171
171
  const result = dispatch(verbPtr, verbBytes.length, bodyPtr, bodyBytes.length);
172
172
  const ptr = Number(result & 0xffffffffn);
173
173
  const len = Number(result >> 32n);
174
- const out = new TextDecoder().decode(new Uint8Array(instance.exports.memory.buffer, ptr, len));
174
+ const buffer = instance.exports.memory.buffer;
175
+ guardWasmRange(buffer, ptr, len, `dispatch_verb(${verb})`);
176
+ const out = new TextDecoder().decode(new Uint8Array(buffer, ptr, len));
175
177
  try { instance.exports.plugkit_free(ptr, len); } catch (_) {}
176
178
  return out;
177
179
  } finally {
@@ -1234,7 +1236,7 @@ function createWasiShim(instanceRef) {
1234
1236
  const base = iovs_ptr + i * 8;
1235
1237
  const ptr = dv.getUint32(base, true);
1236
1238
  const len = dv.getUint32(base + 4, true);
1237
- if (len > 0) {
1239
+ if (len > 0 && ptr + len <= buf.byteLength) {
1238
1240
  chunks.push(new Uint8Array(buf, ptr, len).slice());
1239
1241
  total += len;
1240
1242
  }
@@ -1300,14 +1302,25 @@ function createWasiShim(instanceRef) {
1300
1302
  });
1301
1303
  }
1302
1304
 
1305
+ function guardWasmRange(buffer, ptr, len, where) {
1306
+ const total = buffer.byteLength;
1307
+ if (!Number.isInteger(ptr) || !Number.isInteger(len) || ptr < 0 || len < 0 || ptr + len > total) {
1308
+ throw new Error(`wasm-memory-read-out-of-bounds at ${where}: ptr=${ptr} len=${len} buffer=${total} -- corrupt (ptr,len) from wasm, refusing the read instead of crashing the dispatch loop`);
1309
+ }
1310
+ }
1311
+
1303
1312
  function readWasmBytes(instance, ptr, len) {
1304
1313
  if (ptr === 0 || len === 0) return new Uint8Array(0);
1305
- return new Uint8Array(instance.exports.memory.buffer, ptr, len).slice();
1314
+ const buffer = instance.exports.memory.buffer;
1315
+ guardWasmRange(buffer, ptr, len, 'readWasmBytes');
1316
+ return new Uint8Array(buffer, ptr, len).slice();
1306
1317
  }
1307
1318
 
1308
1319
  function readWasmStr(instance, ptr, len) {
1309
1320
  if (ptr === 0 || len === 0) return '';
1310
- const bytes = new Uint8Array(instance.exports.memory.buffer, ptr, len);
1321
+ const buffer = instance.exports.memory.buffer;
1322
+ guardWasmRange(buffer, ptr, len, 'readWasmStr');
1323
+ const bytes = new Uint8Array(buffer, ptr, len);
1311
1324
  return new TextDecoder('utf-8').decode(bytes);
1312
1325
  }
1313
1326
 
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1599",
3
+ "version": "2.0.1601",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "plugkitVersion": "0.1.680"
20
+ "plugkitVersion": "0.1.681"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1599",
3
+ "version": "2.0.1601",
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",