gm-skill 2.0.1533 → 2.0.1535
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 +38 -1
- 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.1535",
|
|
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
|
-
(
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1535",
|
|
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",
|