gm-skill 2.0.1534 → 2.0.1536

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.635
1
+ 0.1.636
@@ -1 +1 @@
1
- eaef35fadc535e11a1e1d2030e8cad3014fd7dd5fc032a79ab5c16ccac44252d plugkit.wasm
1
+ 4be259452e64832103a03b53250d83f3f034102aca70c7984a5c7bd942c9aae5 plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1534",
3
+ "version": "2.0.1536",
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": {
@@ -3668,7 +3668,44 @@ async function tryInstantiate(wasmPath) {
3668
3668
  return { instance, instanceRef };
3669
3669
  }
3670
3670
 
3671
- (async () => {
3671
+ // In-process API. Lets a host (e.g. freddie) drive memorize/recall/auto-recall against
3672
+ // .gm/rs-learn.db WITHOUT running the spool daemon loop: the wasm instance is created once
3673
+ // and cached, and dispatch() returns parsed JSON. The wasm host functions resolve the project
3674
+ // .gm dir from CLAUDE_PROJECT_DIR/cwd, so set those in the host process before first dispatch.
3675
+ let _sharedPlugkit = null;
3676
+ export async function createPlugkit(opts = {}) {
3677
+ if (_sharedPlugkit && !opts.fresh) return _sharedPlugkit;
3678
+ const wasmPath = opts.wasmPath || path.join(GM_TOOLS_ROOT, 'plugkit.wasm');
3679
+ if (!fs.existsSync(wasmPath)) throw new Error(`plugkit wasm not installed at ${wasmPath} -- run: bun x gm-plugkit@latest spool`);
3680
+ let instance;
3681
+ try {
3682
+ ({ instance } = await tryInstantiate(wasmPath));
3683
+ } catch (e) {
3684
+ const healed = await selfHeal(`${e && e.name || 'instantiate'}: ${e && e.message}`);
3685
+ if (!healed) throw e;
3686
+ ({ instance } = await tryInstantiate(wasmPath));
3687
+ }
3688
+ const api = {
3689
+ dispatch(verb, body) {
3690
+ const raw = dispatchVerbToWasmInternal(instance, verb, typeof body === 'string' ? body : JSON.stringify(body || {}));
3691
+ if (raw == null) return null;
3692
+ try { return JSON.parse(raw); } catch (_) { return raw; }
3693
+ },
3694
+ version() { return resolveVersion(instance); },
3695
+ _instance: instance,
3696
+ };
3697
+ if (!opts.fresh) _sharedPlugkit = api;
3698
+ return api;
3699
+ }
3700
+
3701
+ const _isCliEntry = (() => {
3702
+ try {
3703
+ if (!process.argv[1]) return false;
3704
+ return path.resolve(fileURLToPath(import.meta.url)) === path.resolve(process.argv[1]);
3705
+ } catch (_) { return false; }
3706
+ })();
3707
+
3708
+ if (_isCliEntry) (async () => {
3672
3709
  try {
3673
3710
  const wasmPath = path.join(GM_TOOLS_ROOT, 'plugkit.wasm');
3674
3711
 
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1534",
3
+ "version": "2.0.1536",
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.635"
20
+ "plugkitVersion": "0.1.636"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1534",
3
+ "version": "2.0.1536",
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",