gm-plugkit 2.0.1309 → 2.0.1310
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 +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1310",
|
|
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
|
@@ -1615,6 +1615,15 @@ function makeHostFunctions(instanceRef) {
|
|
|
1615
1615
|
const prefix = level >= 3 ? '[plugkit-wasm:err]' : level >= 2 ? '[plugkit-wasm:warn]' : '[plugkit-wasm]';
|
|
1616
1616
|
if (level >= 2) console.error(`${prefix} ${msg}`);
|
|
1617
1617
|
else console.log(`${prefix} ${msg}`);
|
|
1618
|
+
const evtMatch = msg.match(/^evt:\s*(\{.*\})\s*$/);
|
|
1619
|
+
if (evtMatch) {
|
|
1620
|
+
try {
|
|
1621
|
+
const ev = JSON.parse(evtMatch[1]);
|
|
1622
|
+
const eventName = ev.event || 'wasm.event';
|
|
1623
|
+
const { event: _e, ts: _ts, sess: _s, sub: _sub, ...fields } = ev;
|
|
1624
|
+
logEvent(ev.sub || 'plugkit', eventName, fields);
|
|
1625
|
+
} catch (_) {}
|
|
1626
|
+
}
|
|
1618
1627
|
return 0;
|
|
1619
1628
|
} catch (e) {
|
|
1620
1629
|
return 0;
|