gm-plugkit 2.0.1218 → 2.0.1219
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 +1 -1
- package/plugkit-wasm-wrapper.js +27 -1
- package/plugkit.sha256 +1 -1
- package/plugkit.version +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1219",
|
|
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": {
|
package/plugkit-wasm-wrapper.js
CHANGED
|
@@ -1223,7 +1223,17 @@ function makeHostFunctions(instanceRef) {
|
|
|
1223
1223
|
const opts = optsStr ? JSON.parse(optsStr) : {};
|
|
1224
1224
|
const lang = opts.lang || 'nodejs';
|
|
1225
1225
|
const cwd = opts.cwd || process.cwd();
|
|
1226
|
-
const
|
|
1226
|
+
const rawTimeout = opts.timeoutMs;
|
|
1227
|
+
if (rawTimeout === undefined || rawTimeout === null || typeof rawTimeout !== 'number' || !Number.isFinite(rawTimeout) || rawTimeout <= 0 || !Number.isInteger(rawTimeout)) {
|
|
1228
|
+
return writeWasmJson(instanceRef.value, {
|
|
1229
|
+
ok: false,
|
|
1230
|
+
error: 'missing timeoutMs',
|
|
1231
|
+
required: 'positive integer milliseconds',
|
|
1232
|
+
paper_ref: '§20',
|
|
1233
|
+
received: rawTimeout === undefined ? null : rawTimeout,
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
const timeoutMs = rawTimeout;
|
|
1227
1237
|
let cmd, args;
|
|
1228
1238
|
if (lang === 'nodejs' || lang === 'js') { cmd = process.execPath; args = ['-e', code]; }
|
|
1229
1239
|
else if (lang === 'python') { cmd = 'python'; args = ['-c', code]; }
|
|
@@ -1755,6 +1765,13 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
1755
1765
|
const sessForRecall = readCurrentSess();
|
|
1756
1766
|
if (isInstructionTurnStart(sessForRecall)) {
|
|
1757
1767
|
autoRecallPayload = tryAutoRecallForTurnEntry(instance, sessForRecall, process.cwd());
|
|
1768
|
+
try {
|
|
1769
|
+
const _spoolDir = path.join(process.cwd(), '.gm', 'exec-spool');
|
|
1770
|
+
for (const _f of ['.turn-browser-edits.json', '.turn-browser-witnessed']) {
|
|
1771
|
+
const _p = path.join(_spoolDir, _f);
|
|
1772
|
+
if (fs.existsSync(_p)) fs.unlinkSync(_p);
|
|
1773
|
+
}
|
|
1774
|
+
} catch (_) {}
|
|
1758
1775
|
}
|
|
1759
1776
|
}
|
|
1760
1777
|
|
|
@@ -1781,6 +1798,15 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
1781
1798
|
logEvent('plugkit', 'dispatch.end', { verb, task: taskBase, dur_ms, out_bytes: resultStr.length });
|
|
1782
1799
|
emitOrchestratorEvents(verb, taskBase, resultStr);
|
|
1783
1800
|
|
|
1801
|
+
if (verb === 'browser') {
|
|
1802
|
+
try {
|
|
1803
|
+
const witnessFile = path.join(process.cwd(), '.gm', 'exec-spool', '.turn-browser-witnessed');
|
|
1804
|
+
fs.mkdirSync(path.dirname(witnessFile), { recursive: true });
|
|
1805
|
+
fs.writeFileSync(witnessFile, JSON.stringify({ ts: Date.now(), task: taskBase, dur_ms }));
|
|
1806
|
+
logEvent('plugkit', 'browser.witness-marked', { task: taskBase });
|
|
1807
|
+
} catch (_) {}
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1784
1810
|
try { instance.exports.plugkit_free(verbPtr, verbBytes.length); } catch (_) {}
|
|
1785
1811
|
try { instance.exports.plugkit_free(bodyPtr, bodyBytes.length); } catch (_) {}
|
|
1786
1812
|
try { instance.exports.plugkit_free(ptr, len); } catch (_) {}
|
package/plugkit.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"plugkit.wasm":"
|
|
1
|
+
{"plugkit.wasm":"0ce920f00138b9524a0a1ad062dab691e4959497853644a7d06403c2b77ed480"}
|
package/plugkit.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.447
|