@remix_labs/machine-starter 2.2048.0-dev → 2.2053.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 +56 -48
- package/groovebox_build.js +1 -1
- package/machine-wasm.worker.js +1 -1
- package/package.json +2 -2
package/common.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GROOVEBOX_BUILD } from "./groovebox_build.js";
|
|
2
|
+
import { mixcoreFromConfigStarter } from "./mixcore.js";
|
|
2
3
|
import { nanoid } from "nanoid";
|
|
3
4
|
|
|
4
5
|
let workers = {};
|
|
@@ -56,55 +57,62 @@ function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaM
|
|
|
56
57
|
})
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
// See `mix-rs/mixcore/bindings/javascript/mixcore.js` for a description of the
|
|
61
|
+
// values of config.mixcore.
|
|
62
|
+
async function StartWASM2(hub, config) {
|
|
60
63
|
console.log("GROOVEBOX_BUILD (machine-starter)", GROOVEBOX_BUILD);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
64
|
+
let channel = await hub.newChannel();
|
|
65
|
+
// injected by either index.js or node.js
|
|
66
|
+
let worker = globalThis.GetMachineWASMWorker();
|
|
67
|
+
workers[config.vmID] = worker;
|
|
68
|
+
let mixcoreConfig = config.mixcore;
|
|
69
|
+
let localFFIs = config.localFFIs;
|
|
70
|
+
let localFFIkind = {};
|
|
71
|
+
let localFFIfuns = {};
|
|
72
|
+
|
|
73
|
+
let mixcore = await mixcoreFromConfigStarter(mixcoreConfig);
|
|
74
|
+
if (mixcore !== null) {
|
|
75
|
+
localFFIs = {...localFFIs, ...mixcore.localFFIs()};
|
|
76
|
+
mixcoreConfig = null;
|
|
77
|
+
}
|
|
78
|
+
if (localFFIs) {
|
|
79
|
+
for (const [k, v] of Object.entries(localFFIs)) {
|
|
80
|
+
localFFIfuns[k] = {...v};
|
|
81
|
+
if (v.isRaw && (v.canFail || v.useJsonDecoder)) {
|
|
82
|
+
console.error("A raw, local FFI must neither be failing nor use the JSON decoder: " + k);
|
|
83
|
+
} else {
|
|
84
|
+
localFFIkind[k] = {...v};
|
|
85
|
+
delete localFFIkind[k].run;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
let vm_kind = { isRaw:false, canFail:false, useJsonDecoder:false};
|
|
89
|
+
localFFIkind["$vm_start"] = vm_kind;
|
|
90
|
+
localFFIfuns["$vm_start"] = ffi_vm_start;
|
|
91
|
+
localFFIkind["$vm_stop"] = vm_kind;
|
|
92
|
+
localFFIfuns["$vm_stop"] = ffi_vm_stop;
|
|
93
|
+
}
|
|
94
|
+
let config_msg =
|
|
95
|
+
{ "_rmx_type": "msg_vm_configure",
|
|
96
|
+
"baseURL": config.baseURL,
|
|
97
|
+
"org": config.org,
|
|
98
|
+
"workspace": config.workspace,
|
|
99
|
+
"vmID": config.vmID,
|
|
100
|
+
"user": config.user,
|
|
101
|
+
"token": config.token,
|
|
102
|
+
"hub": channel.port,
|
|
103
|
+
"outputViaMQTT": !(config.noOutputViaMQTT),
|
|
104
|
+
"machType": config.machType,
|
|
105
|
+
"debugMask": initialMask,
|
|
106
|
+
"localFFIs": localFFIkind,
|
|
107
|
+
"allowInsecureHttp": globalThis.GROOVEBOX_ALLOW_INSECURE_HTTP,
|
|
108
|
+
"interceptFFI": config.interceptFFI,
|
|
109
|
+
"interceptDynloadFFI": config.interceptDynloadFFI,
|
|
110
|
+
"mixcore": mixcoreConfig,
|
|
111
|
+
};
|
|
112
|
+
worker.postMessage(config_msg, [ channel.port ]);
|
|
113
|
+
if (localFFIs)
|
|
114
|
+
setupLocalFFIs(hub, config, localFFIfuns); // don't await!
|
|
115
|
+
return worker;
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
async function ffi_vm_start(conn, args) {
|
package/groovebox_build.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var GROOVEBOX_BUILD = "
|
|
1
|
+
var GROOVEBOX_BUILD = "2198";
|
|
2
2
|
export { GROOVEBOX_BUILD }
|