@remix_labs/machine-starter 2.3211.0-dev → 2.3215.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
|
@@ -99,8 +99,6 @@ globalThis.MixSetMask = (m => {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
const DEBUG_STATE = 4;
|
|
103
|
-
|
|
104
102
|
function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaMQTT) {
|
|
105
103
|
return StartWASM2(hub, {
|
|
106
104
|
baseURL: baseURL,
|
|
@@ -359,12 +357,10 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
|
|
|
359
357
|
return;
|
|
360
358
|
}
|
|
361
359
|
let name = msg.payload.name;
|
|
362
|
-
let call_id = msg.payload.
|
|
360
|
+
let call_id = msg.payload.call_id;
|
|
363
361
|
let args = decode(msg.payload.args);
|
|
364
362
|
let fun = localFFIs[name];
|
|
365
|
-
|
|
366
|
-
console.debug("[groovebox-starter] local FFI call", vmID, call_id, name);
|
|
367
|
-
};
|
|
363
|
+
// console.log("[machine-starter] local FFI call", vmID, call_id, name);
|
|
368
364
|
try {
|
|
369
365
|
if (!fun) throw new Error("No such local FFI in groovebox starter: " + name);
|
|
370
366
|
let connector =
|
|
@@ -377,26 +373,13 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
|
|
|
377
373
|
let r = fun instanceof Function ? fun(connector, args) : fun.run(connector, args);
|
|
378
374
|
if (r instanceof Promise) {
|
|
379
375
|
// r.catch(_ => null); // prevent "unhandled rejection"
|
|
380
|
-
if (initialMask & DEBUG_STATE) {
|
|
381
|
-
console.debug("[groovebox-starter] running FFI call asynchronously", vmID, call_id, name);
|
|
382
|
-
}
|
|
383
376
|
await comm.later(call_id);
|
|
384
377
|
let value = await r;
|
|
385
|
-
if (initialMask & DEBUG_STATE) {
|
|
386
|
-
console.debug("[groovebox-starter] async FFI call returned", vmID, call_id, name);
|
|
387
|
-
};
|
|
388
378
|
await comm.returnOrFail(fun, call_id, value);
|
|
389
379
|
} else {
|
|
390
|
-
if (initialMask & DEBUG_STATE) {
|
|
391
|
-
console.debug("[groovebox-starter] sync FFI call returned", vmID, call_id, name);
|
|
392
|
-
};
|
|
393
380
|
await comm.returnOrFail(fun, call_id, r);
|
|
394
381
|
}
|
|
395
382
|
} catch (reason) {
|
|
396
|
-
if (initialMask & DEBUG_STATE) {
|
|
397
|
-
console.debug("[groovebox-starter] FFI call exception", vmID, call_id, name);
|
|
398
|
-
console.debug("[groovebox-starter] exception", reason);
|
|
399
|
-
};
|
|
400
383
|
await comm.error(call_id, reason.message, reason.stack);
|
|
401
384
|
}
|
|
402
385
|
}
|
|
@@ -439,14 +422,14 @@ class FFIComm {
|
|
|
439
422
|
}
|
|
440
423
|
later(call_id) {
|
|
441
424
|
let r_payload =
|
|
442
|
-
{
|
|
425
|
+
{ call_id: call_id,
|
|
443
426
|
};
|
|
444
427
|
let response = this.hub.newLocalMessage("msg_ffi_later", "starter", r_payload);
|
|
445
428
|
return this.channel.publish("/local/" + this.vmID + "/ffi/return", response, false);
|
|
446
429
|
}
|
|
447
430
|
return_(fun, call_id, result) {
|
|
448
431
|
let r_payload =
|
|
449
|
-
{
|
|
432
|
+
{ call_id: call_id,
|
|
450
433
|
value: fun.useJsonDecoder ? result : encode(result)
|
|
451
434
|
};
|
|
452
435
|
let response = this.hub.newLocalMessage("msg_ffi_return", "starter", r_payload);
|
|
@@ -454,7 +437,7 @@ class FFIComm {
|
|
|
454
437
|
}
|
|
455
438
|
error(call_id, message, stack) {
|
|
456
439
|
let r_payload =
|
|
457
|
-
{
|
|
440
|
+
{ call_id: call_id,
|
|
458
441
|
message: message,
|
|
459
442
|
stack: stack === undefined ? [] : stack,
|
|
460
443
|
};
|
package/groovebox_build.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var GROOVEBOX_BUILD = "
|
|
1
|
+
var GROOVEBOX_BUILD = "3215";
|
|
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.3215.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.3215.0-dev",
|
|
15
15
|
"nanoid": "^5.0.2",
|
|
16
16
|
"web-worker": "^1.2.0"
|
|
17
17
|
},
|
package/webpack.config.js
CHANGED