@remix_labs/machine-starter 2.2923.0-dev → 2.2927.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 +5 -22
- package/groovebox_build.js +1 -1
- package/node.js +0 -4
- package/package.json +2 -2
- package/webpack.config.js +0 -4
package/common.js
CHANGED
|
@@ -56,8 +56,6 @@ globalThis.MixSetMask = (m => {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
const DEBUG_STATE = 4;
|
|
60
|
-
|
|
61
59
|
function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaMQTT) {
|
|
62
60
|
return StartWASM2(hub, {
|
|
63
61
|
baseURL: baseURL,
|
|
@@ -296,12 +294,10 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
|
|
|
296
294
|
return;
|
|
297
295
|
}
|
|
298
296
|
let name = msg.payload.name;
|
|
299
|
-
let call_id = msg.payload.
|
|
297
|
+
let call_id = msg.payload.call_id;
|
|
300
298
|
let args = decode(msg.payload.args);
|
|
301
299
|
let fun = localFFIs[name];
|
|
302
|
-
|
|
303
|
-
console.debug("[groovebox-starter] local FFI call", vmID, call_id, name);
|
|
304
|
-
};
|
|
300
|
+
console.log("[groovebox-starter] local FFI call", vmID, call_id, name);
|
|
305
301
|
try {
|
|
306
302
|
if (!fun) throw new Error("No such local FFI in groovebox starter: " + name);
|
|
307
303
|
let connector =
|
|
@@ -314,26 +310,13 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
|
|
|
314
310
|
let r = fun instanceof Function ? fun(connector, args) : fun.run(connector, args);
|
|
315
311
|
if (r instanceof Promise) {
|
|
316
312
|
// 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
|
-
}
|
|
320
313
|
await comm.later(call_id);
|
|
321
314
|
let value = await r;
|
|
322
|
-
if (initialMask & DEBUG_STATE) {
|
|
323
|
-
console.debug("[groovebox-starter] async FFI call returned", vmID, call_id, name);
|
|
324
|
-
};
|
|
325
315
|
await comm.returnOrFail(fun, call_id, value);
|
|
326
316
|
} else {
|
|
327
|
-
if (initialMask & DEBUG_STATE) {
|
|
328
|
-
console.debug("[groovebox-starter] sync FFI call returned", vmID, call_id, name);
|
|
329
|
-
};
|
|
330
317
|
await comm.returnOrFail(fun, call_id, r);
|
|
331
318
|
}
|
|
332
319
|
} 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
|
-
};
|
|
337
320
|
await comm.error(call_id, reason.message, reason.stack);
|
|
338
321
|
}
|
|
339
322
|
}
|
|
@@ -347,14 +330,14 @@ class FFIComm {
|
|
|
347
330
|
}
|
|
348
331
|
later(call_id) {
|
|
349
332
|
let r_payload =
|
|
350
|
-
{
|
|
333
|
+
{ call_id: call_id,
|
|
351
334
|
};
|
|
352
335
|
let response = this.hub.newLocalMessage("msg_ffi_later", "starter", r_payload);
|
|
353
336
|
return this.channel.publish("/local/" + this.vmID + "/ffi/return", response, false);
|
|
354
337
|
}
|
|
355
338
|
return_(fun, call_id, result) {
|
|
356
339
|
let r_payload =
|
|
357
|
-
{
|
|
340
|
+
{ call_id: call_id,
|
|
358
341
|
value: fun.useJsonDecoder ? result : encode(result)
|
|
359
342
|
};
|
|
360
343
|
let response = this.hub.newLocalMessage("msg_ffi_return", "starter", r_payload);
|
|
@@ -362,7 +345,7 @@ class FFIComm {
|
|
|
362
345
|
}
|
|
363
346
|
error(call_id, message, stack) {
|
|
364
347
|
let r_payload =
|
|
365
|
-
{
|
|
348
|
+
{ call_id: call_id,
|
|
366
349
|
message: message,
|
|
367
350
|
stack: stack === undefined ? [] : stack,
|
|
368
351
|
};
|
package/groovebox_build.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var GROOVEBOX_BUILD = "
|
|
1
|
+
var GROOVEBOX_BUILD = "3222";
|
|
2
2
|
export { GROOVEBOX_BUILD }
|
package/node.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import Process from "process";
|
|
2
|
-
import Console from "console"
|
|
3
2
|
globalThis.Process = Process;
|
|
4
|
-
globalThis.console = new Console.Console({stdout: process.stderr, stderr: process.stderr });
|
|
5
|
-
// redirect stdout to stderr to avoid that log messages appear in the wrong
|
|
6
|
-
// order
|
|
7
3
|
|
|
8
4
|
// NB: The only way I've made this work in node+webpack is if:
|
|
9
5
|
//
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remix_labs/machine-starter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2927.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.
|
|
14
|
+
"@remix_labs/hub-client": "2.2927.0-dev",
|
|
15
15
|
"nanoid": "^5.0.2",
|
|
16
16
|
"web-worker": "^1.2.0"
|
|
17
17
|
},
|
package/webpack.config.js
CHANGED