@remix_labs/mixc-starter 2.7805.0 → 2.7810.0
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/mixc-worker.node.mjs +32 -7
- package/mixc-worker.worker.js +32 -7
- package/package.json +1 -1
- package/protoquery_build.js +2 -2
package/mixc-worker.node.mjs
CHANGED
|
@@ -22279,7 +22279,7 @@ var dist_default = /*#__PURE__*/__webpack_require__.n(wasi_js_dist);
|
|
|
22279
22279
|
var browser = __webpack_require__(7986);
|
|
22280
22280
|
var browser_default = /*#__PURE__*/__webpack_require__.n(browser);
|
|
22281
22281
|
;// CONCATENATED MODULE: ./protoquery_build.js
|
|
22282
|
-
var PROTOQUERY_WASM_BUILD = "
|
|
22282
|
+
var PROTOQUERY_WASM_BUILD = "7810";
|
|
22283
22283
|
var PROTOQUERY_STDLIB_ID = "stdlib-1@ee1f4eeddf87628e81f2ffdec0187263";
|
|
22284
22284
|
|
|
22285
22285
|
|
|
@@ -22349,6 +22349,12 @@ let nanoid = (size = 21) => {
|
|
|
22349
22349
|
|
|
22350
22350
|
|
|
22351
22351
|
|
|
22352
|
+
let debugMask = 0;
|
|
22353
|
+
const logMaskTopic = "/logMask";
|
|
22354
|
+
|
|
22355
|
+
// debug flags < 1024 are defined on the C side (memory.h)
|
|
22356
|
+
const DEBUG_COMPILER = 8192;
|
|
22357
|
+
|
|
22352
22358
|
function setup() {
|
|
22353
22359
|
worker_console.log("PROTOQUERY_WASM_BUILD (mixc-worker)", PROTOQUERY_WASM_BUILD);
|
|
22354
22360
|
if (!isLittleEndian()) {
|
|
@@ -22393,6 +22399,8 @@ async function configure(msg) {
|
|
|
22393
22399
|
};
|
|
22394
22400
|
globalThis.stringIdMap = new Map();
|
|
22395
22401
|
globalThis.compilerIdMap = new Map();
|
|
22402
|
+
let lmSub = await hub.subscribe(logMaskTopic);
|
|
22403
|
+
await logMaskSub(lmSub);
|
|
22396
22404
|
await start_compiler();
|
|
22397
22405
|
sub_sessionless(); // no await
|
|
22398
22406
|
let announcement = new JSONMessage("msg_mixc_announce", "mixc-worker", {success:true, stdlib: PROTOQUERY_STDLIB_ID, hello: "hi" });
|
|
@@ -22400,6 +22408,20 @@ async function configure(msg) {
|
|
|
22400
22408
|
await globalThis.hub.publish("/org/" + globalThis.config.org + "/ws/" + globalThis.config.workspace + "/mixc/announce", announcement, retained);
|
|
22401
22409
|
}
|
|
22402
22410
|
|
|
22411
|
+
async function logMaskSub(sub) {
|
|
22412
|
+
logMaskSubLoop(sub).catch(e => worker_console.log("mix compiler: Error", e))
|
|
22413
|
+
// but don't wait on it
|
|
22414
|
+
}
|
|
22415
|
+
|
|
22416
|
+
async function logMaskSubLoop(sub) {
|
|
22417
|
+
while (true) {
|
|
22418
|
+
let msg = await sub.next();
|
|
22419
|
+
let m = msg.payload.mask;
|
|
22420
|
+
worker_console.log("mix compiler: Setting debug mask to: ", m);
|
|
22421
|
+
debugMask = m;
|
|
22422
|
+
}
|
|
22423
|
+
}
|
|
22424
|
+
|
|
22403
22425
|
async function sub_sessionless() {
|
|
22404
22426
|
let topicBase = "/org/" + globalThis.config.org + "/ws/" + globalThis.config.workspace + "/mixc";
|
|
22405
22427
|
let sub = await globalThis.hub.subscribe(topicBase + "/sessionless");
|
|
@@ -22412,8 +22434,8 @@ async function sub_sessionless_loop(sub) {
|
|
|
22412
22434
|
try {
|
|
22413
22435
|
await sub_sessionless_handle(undefined, msg);
|
|
22414
22436
|
} catch (e) {
|
|
22415
|
-
worker_console.log("Error", e);
|
|
22416
|
-
worker_console.log("Stack", e.stack);
|
|
22437
|
+
worker_console.log("mix compiler: Error", e);
|
|
22438
|
+
worker_console.log("mix compiler: Stack", e.stack);
|
|
22417
22439
|
}
|
|
22418
22440
|
}
|
|
22419
22441
|
}
|
|
@@ -22485,7 +22507,7 @@ async function sub_session_loop(compilerId, sessionBase, sub) {
|
|
|
22485
22507
|
try {
|
|
22486
22508
|
await sub_session_handle(compilerId, sessionBase, msg);
|
|
22487
22509
|
} catch (e) {
|
|
22488
|
-
worker_console.log("Error", e);
|
|
22510
|
+
worker_console.log("mix compiler: Error", e);
|
|
22489
22511
|
}
|
|
22490
22512
|
}
|
|
22491
22513
|
}
|
|
@@ -22587,7 +22609,8 @@ async function handle_request(rtopic, req_name, msg, req_hasArg, req_binArg, wit
|
|
|
22587
22609
|
let sessionBase = topicBase + "/session/" + stringId;
|
|
22588
22610
|
let sub = await globalThis.hub.subscribe(sessionBase + "/request");
|
|
22589
22611
|
sub_session_loop(compilerId, sessionBase, sub); // no await
|
|
22590
|
-
|
|
22612
|
+
if (debugMask & DEBUG_COMPILER)
|
|
22613
|
+
worker_console.log("mix compiler: new session: ", stringId);
|
|
22591
22614
|
};
|
|
22592
22615
|
globalThis.hub.publish(rtopic, response, false);
|
|
22593
22616
|
}
|
|
@@ -22828,7 +22851,8 @@ function mixc_doRequest(req_name, req_args, req_binArg) {
|
|
|
22828
22851
|
let mem8 = globalThis.instance.mem8;
|
|
22829
22852
|
mem8.subarray(binArg_buf, binArg_buf + req_binArg.length).set(req_binArg);
|
|
22830
22853
|
|
|
22831
|
-
|
|
22854
|
+
if (debugMask & DEBUG_COMPILER)
|
|
22855
|
+
worker_console.log("mix compiler: request", req);
|
|
22832
22856
|
globalThis.instance.call(wasm.do_request, req_buf, 0);
|
|
22833
22857
|
wasm.free(req_buf);
|
|
22834
22858
|
|
|
@@ -22873,7 +22897,8 @@ async function demo_request() {
|
|
|
22873
22897
|
let resp_buf_len = globalThis.instance.call(wasm.get_json_output_length);
|
|
22874
22898
|
|
|
22875
22899
|
let resp_j = copyOutCString(resp_buf, resp_buf_len);
|
|
22876
|
-
|
|
22900
|
+
if (debugMask & DEBUG_COMPILER)
|
|
22901
|
+
worker_console.log("mix compiler: about ", resp_j);
|
|
22877
22902
|
}
|
|
22878
22903
|
|
|
22879
22904
|
setup();
|
package/mixc-worker.worker.js
CHANGED
|
@@ -24235,7 +24235,7 @@ var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
|
|
|
24235
24235
|
var browser = __webpack_require__(7986);
|
|
24236
24236
|
var browser_default = /*#__PURE__*/__webpack_require__.n(browser);
|
|
24237
24237
|
;// CONCATENATED MODULE: ./protoquery_build.js
|
|
24238
|
-
var PROTOQUERY_WASM_BUILD = "
|
|
24238
|
+
var PROTOQUERY_WASM_BUILD = "7810";
|
|
24239
24239
|
var PROTOQUERY_STDLIB_ID = "stdlib-1@ee1f4eeddf87628e81f2ffdec0187263";
|
|
24240
24240
|
|
|
24241
24241
|
|
|
@@ -24286,6 +24286,12 @@ let nanoid = (size = 21) =>
|
|
|
24286
24286
|
|
|
24287
24287
|
|
|
24288
24288
|
|
|
24289
|
+
let debugMask = 0;
|
|
24290
|
+
const logMaskTopic = "/logMask";
|
|
24291
|
+
|
|
24292
|
+
// debug flags < 1024 are defined on the C side (memory.h)
|
|
24293
|
+
const DEBUG_COMPILER = 8192;
|
|
24294
|
+
|
|
24289
24295
|
function setup() {
|
|
24290
24296
|
worker_console.log("PROTOQUERY_WASM_BUILD (mixc-worker)", PROTOQUERY_WASM_BUILD);
|
|
24291
24297
|
if (!isLittleEndian()) {
|
|
@@ -24330,6 +24336,8 @@ async function configure(msg) {
|
|
|
24330
24336
|
};
|
|
24331
24337
|
globalThis.stringIdMap = new Map();
|
|
24332
24338
|
globalThis.compilerIdMap = new Map();
|
|
24339
|
+
let lmSub = await hub.subscribe(logMaskTopic);
|
|
24340
|
+
await logMaskSub(lmSub);
|
|
24333
24341
|
await start_compiler();
|
|
24334
24342
|
sub_sessionless(); // no await
|
|
24335
24343
|
let announcement = new JSONMessage("msg_mixc_announce", "mixc-worker", {success:true, stdlib: PROTOQUERY_STDLIB_ID, hello: "hi" });
|
|
@@ -24337,6 +24345,20 @@ async function configure(msg) {
|
|
|
24337
24345
|
await globalThis.hub.publish("/org/" + globalThis.config.org + "/ws/" + globalThis.config.workspace + "/mixc/announce", announcement, retained);
|
|
24338
24346
|
}
|
|
24339
24347
|
|
|
24348
|
+
async function logMaskSub(sub) {
|
|
24349
|
+
logMaskSubLoop(sub).catch(e => worker_console.log("mix compiler: Error", e))
|
|
24350
|
+
// but don't wait on it
|
|
24351
|
+
}
|
|
24352
|
+
|
|
24353
|
+
async function logMaskSubLoop(sub) {
|
|
24354
|
+
while (true) {
|
|
24355
|
+
let msg = await sub.next();
|
|
24356
|
+
let m = msg.payload.mask;
|
|
24357
|
+
worker_console.log("mix compiler: Setting debug mask to: ", m);
|
|
24358
|
+
debugMask = m;
|
|
24359
|
+
}
|
|
24360
|
+
}
|
|
24361
|
+
|
|
24340
24362
|
async function sub_sessionless() {
|
|
24341
24363
|
let topicBase = "/org/" + globalThis.config.org + "/ws/" + globalThis.config.workspace + "/mixc";
|
|
24342
24364
|
let sub = await globalThis.hub.subscribe(topicBase + "/sessionless");
|
|
@@ -24349,8 +24371,8 @@ async function sub_sessionless_loop(sub) {
|
|
|
24349
24371
|
try {
|
|
24350
24372
|
await sub_sessionless_handle(undefined, msg);
|
|
24351
24373
|
} catch (e) {
|
|
24352
|
-
worker_console.log("Error", e);
|
|
24353
|
-
worker_console.log("Stack", e.stack);
|
|
24374
|
+
worker_console.log("mix compiler: Error", e);
|
|
24375
|
+
worker_console.log("mix compiler: Stack", e.stack);
|
|
24354
24376
|
}
|
|
24355
24377
|
}
|
|
24356
24378
|
}
|
|
@@ -24422,7 +24444,7 @@ async function sub_session_loop(compilerId, sessionBase, sub) {
|
|
|
24422
24444
|
try {
|
|
24423
24445
|
await sub_session_handle(compilerId, sessionBase, msg);
|
|
24424
24446
|
} catch (e) {
|
|
24425
|
-
worker_console.log("Error", e);
|
|
24447
|
+
worker_console.log("mix compiler: Error", e);
|
|
24426
24448
|
}
|
|
24427
24449
|
}
|
|
24428
24450
|
}
|
|
@@ -24524,7 +24546,8 @@ async function handle_request(rtopic, req_name, msg, req_hasArg, req_binArg, wit
|
|
|
24524
24546
|
let sessionBase = topicBase + "/session/" + stringId;
|
|
24525
24547
|
let sub = await globalThis.hub.subscribe(sessionBase + "/request");
|
|
24526
24548
|
sub_session_loop(compilerId, sessionBase, sub); // no await
|
|
24527
|
-
|
|
24549
|
+
if (debugMask & DEBUG_COMPILER)
|
|
24550
|
+
worker_console.log("mix compiler: new session: ", stringId);
|
|
24528
24551
|
};
|
|
24529
24552
|
globalThis.hub.publish(rtopic, response, false);
|
|
24530
24553
|
}
|
|
@@ -24765,7 +24788,8 @@ function mixc_doRequest(req_name, req_args, req_binArg) {
|
|
|
24765
24788
|
let mem8 = globalThis.instance.mem8;
|
|
24766
24789
|
mem8.subarray(binArg_buf, binArg_buf + req_binArg.length).set(req_binArg);
|
|
24767
24790
|
|
|
24768
|
-
|
|
24791
|
+
if (debugMask & DEBUG_COMPILER)
|
|
24792
|
+
worker_console.log("mix compiler: request", req);
|
|
24769
24793
|
globalThis.instance.call(wasm.do_request, req_buf, 0);
|
|
24770
24794
|
wasm.free(req_buf);
|
|
24771
24795
|
|
|
@@ -24810,7 +24834,8 @@ async function demo_request() {
|
|
|
24810
24834
|
let resp_buf_len = globalThis.instance.call(wasm.get_json_output_length);
|
|
24811
24835
|
|
|
24812
24836
|
let resp_j = copyOutCString(resp_buf, resp_buf_len);
|
|
24813
|
-
|
|
24837
|
+
if (debugMask & DEBUG_COMPILER)
|
|
24838
|
+
worker_console.log("mix compiler: about ", resp_j);
|
|
24814
24839
|
}
|
|
24815
24840
|
|
|
24816
24841
|
setup();
|
package/package.json
CHANGED
package/protoquery_build.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var PROTOQUERY_BUILD = "
|
|
2
|
-
var PROTOQUERY_WASM_BUILD = "
|
|
1
|
+
var PROTOQUERY_BUILD = "37053";
|
|
2
|
+
var PROTOQUERY_WASM_BUILD = "7810";
|
|
3
3
|
export { PROTOQUERY_BUILD, PROTOQUERY_WASM_BUILD }
|