@remix_labs/machine-starter 2.2909.0-dev → 2.2913.0-dev

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/common.js CHANGED
@@ -56,6 +56,8 @@ globalThis.MixSetMask = (m => {
56
56
  }
57
57
  });
58
58
 
59
+ const DEBUG_STATE = 4;
60
+
59
61
  function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaMQTT) {
60
62
  return StartWASM2(hub, {
61
63
  baseURL: baseURL,
@@ -297,7 +299,9 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
297
299
  let call_id = msg.payload.call_id;
298
300
  let args = decode(msg.payload.args);
299
301
  let fun = localFFIs[name];
300
- console.log("[groovebox-starter] local FFI call", vmID, call_id, name);
302
+ if (initialMask & DEBUG_STATE) {
303
+ console.debug("[groovebox-starter] local FFI call", vmID, call_id, name);
304
+ };
301
305
  try {
302
306
  if (!fun) throw new Error("No such local FFI in groovebox starter: " + name);
303
307
  let connector =
@@ -310,13 +314,26 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
310
314
  let r = fun instanceof Function ? fun(connector, args) : fun.run(connector, args);
311
315
  if (r instanceof Promise) {
312
316
  // r.catch(_ => null); // prevent "unhandled rejection"
317
+ if (initialMask & DEBUG_STATE) {
318
+ console.debug("[groovebox-starter] running FFI call asynchronously", vmID, call_id, name);
319
+ }
313
320
  await comm.later(call_id);
314
321
  let value = await r;
322
+ if (initialMask & DEBUG_STATE) {
323
+ console.debug("[groovebox-starter] async FFI call returned", vmID, call_id, name);
324
+ };
315
325
  await comm.returnOrFail(fun, call_id, value);
316
326
  } else {
327
+ if (initialMask & DEBUG_STATE) {
328
+ console.debug("[groovebox-starter] sync FFI call returned", vmID, call_id, name);
329
+ };
317
330
  await comm.returnOrFail(fun, call_id, r);
318
331
  }
319
332
  } catch (reason) {
333
+ if (initialMask & DEBUG_STATE) {
334
+ console.debug("[groovebox-starter] FFI call exception", vmID, call_id, name);
335
+ console.debug("[groovebox-starter] exception", reason);
336
+ };
320
337
  await comm.error(call_id, reason.message, reason.stack);
321
338
  }
322
339
  }
@@ -1,2 +1,2 @@
1
- var GROOVEBOX_BUILD = "3204";
1
+ var GROOVEBOX_BUILD = "3208";
2
2
  export { GROOVEBOX_BUILD }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix_labs/machine-starter",
3
- "version": "2.2909.0-dev",
3
+ "version": "2.2913.0-dev",
4
4
  "description": "start the groove",
5
5
  "main": "node.js",
6
6
  "browser": "index.js",
@@ -11,7 +11,7 @@
11
11
  "author": "Remixlabs staff",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@remix_labs/hub-client": "2.2909.0-dev",
14
+ "@remix_labs/hub-client": "2.2913.0-dev",
15
15
  "nanoid": "^5.0.2",
16
16
  "web-worker": "^1.2.0"
17
17
  },