gm-skill 2.0.1334 → 2.0.1335

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,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1334",
3
+ "version": "2.0.1335",
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": {
@@ -1752,17 +1752,8 @@ function resolveVersion(instance) {
1752
1752
  try {
1753
1753
  return fs.readFileSync(path.join(GM_TOOLS_ROOT, 'plugkit.version'), 'utf8').trim();
1754
1754
  } catch (_) {}
1755
- try {
1756
- const fn = instance && instance.exports && instance.exports.plugkit_version;
1757
- if (typeof fn === 'function') {
1758
- const result = fn();
1759
- const ptr = Number(result & 0xffffffffn);
1760
- const len = Number(result >> 32n);
1761
- const bytes = new Uint8Array(instance.exports.memory.buffer, ptr, len);
1762
- return new TextDecoder().decode(bytes).trim();
1763
- }
1764
- } catch (_) {}
1765
- return 'unknown';
1755
+ const fromInstance = readInstanceVersion(instance);
1756
+ return fromInstance || 'unknown';
1766
1757
  }
1767
1758
 
1768
1759
  function readFileVersionOnly() {
@@ -1774,10 +1765,22 @@ function readInstanceVersion(instance) {
1774
1765
  const fn = instance && instance.exports && instance.exports.plugkit_version;
1775
1766
  if (typeof fn !== 'function') return null;
1776
1767
  const result = fn();
1777
- const ptr = Number(result & 0xffffffffn);
1778
- const len = Number(result >> 32n);
1779
- const bytes = new Uint8Array(instance.exports.memory.buffer, ptr, len);
1780
- return new TextDecoder().decode(bytes).trim();
1768
+ let ptr, len;
1769
+ if (typeof result === 'bigint') {
1770
+ ptr = Number(result & 0xffffffffn);
1771
+ len = Number(result >> 32n);
1772
+ } else {
1773
+ ptr = Number(result) & 0xffffffff;
1774
+ len = 0;
1775
+ }
1776
+ const buf = new Uint8Array(instance.exports.memory.buffer, ptr, 64);
1777
+ if (len === 0) {
1778
+ let end = 0;
1779
+ while (end < buf.length && buf[end] !== 0) end++;
1780
+ len = end;
1781
+ }
1782
+ if (len === 0) return null;
1783
+ return new TextDecoder().decode(buf.subarray(0, len)).trim() || null;
1781
1784
  } catch (_) { return null; }
1782
1785
  }
1783
1786
 
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1334",
3
+ "version": "2.0.1335",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1334",
3
+ "version": "2.0.1335",
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",