gm-plugkit 2.0.1951 → 2.0.1953

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1951",
3
+ "version": "2.0.1953",
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": {
@@ -4672,7 +4672,7 @@ async function runSpoolWatcher(instance, spoolDir) {
4672
4672
  setInterval(() => { try { scanStalledTurns(); } catch (_) {} }, 30000);
4673
4673
  writeStatus();
4674
4674
 
4675
- setTimeout(() => {
4675
+ setTimeout(async () => {
4676
4676
  try {
4677
4677
  // The boot warmup's codesearch triggers a codeinsight reindex + full
4678
4678
  // in-wasm embed of the project when the stored digest is absent/stale.
@@ -4718,6 +4718,7 @@ async function runSpoolWatcher(instance, spoolDir) {
4718
4718
  if (deferred === 0) break;
4719
4719
  if (deferred === lastDeferred) { stagnant++; if (stagnant >= 4) break; } else { stagnant = 0; }
4720
4720
  lastDeferred = deferred;
4721
+ await new Promise((r) => setImmediate(r));
4721
4722
  }
4722
4723
  writeStatus();
4723
4724
  logEvent('plugkit', 'boot.index-warmup', { ms: Date.now() - t0, passes, converged: lastDeferred === -1 || lastDeferred === 0 });
@@ -5274,18 +5275,23 @@ async function selfHeal(reason) {
5274
5275
 
5275
5276
  async function tryInstantiate(wasmPath) {
5276
5277
  const wasmBuffer = fs.readFileSync(wasmPath);
5278
+ const keepBusy = setInterval(() => { try { _writeStatusBusy(60000); } catch (_) {} }, 15000);
5277
5279
  try { _writeStatusBusy(60000); } catch (_) {}
5278
- const wasmModule = await WebAssembly.compile(wasmBuffer);
5279
- try { _writeStatusBusy(60000); } catch (_) {}
5280
- const instanceRef = { value: null };
5281
- const hostFunctions = makeHostFunctions(instanceRef);
5282
- const importObject = {
5283
- env: hostFunctions,
5284
- wasi_snapshot_preview1: createWasiShim(instanceRef),
5285
- };
5286
- const instance = await WebAssembly.instantiate(wasmModule, importObject);
5287
- instanceRef.value = instance;
5288
- return { instance, instanceRef };
5280
+ try {
5281
+ const wasmModule = await WebAssembly.compile(wasmBuffer);
5282
+ try { _writeStatusBusy(60000); } catch (_) {}
5283
+ const instanceRef = { value: null };
5284
+ const hostFunctions = makeHostFunctions(instanceRef);
5285
+ const importObject = {
5286
+ env: hostFunctions,
5287
+ wasi_snapshot_preview1: createWasiShim(instanceRef),
5288
+ };
5289
+ const instance = await WebAssembly.instantiate(wasmModule, importObject);
5290
+ instanceRef.value = instance;
5291
+ return { instance, instanceRef };
5292
+ } finally {
5293
+ clearInterval(keepBusy);
5294
+ }
5289
5295
  }
5290
5296
 
5291
5297
  let _sharedPlugkit = null;