@ai-ecoverse/slicc-kernel 1.141.3 → 1.142.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/README.md +3 -1
- package/dist/kernel-worker.js +1 -1
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +101 -84
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +17 -4
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +2 -1
- package/dist/process-worker.js.map +2 -2
- package/dist/types/node.d.ts +1 -0
- package/package.json +2 -2
package/dist/node.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/node.ts
|
|
2
|
+
import { isAbsolute } from "node:path";
|
|
2
3
|
import { MessageChannel as MessageChannel2, Worker } from "node:worker_threads";
|
|
3
4
|
|
|
4
5
|
// src/bytes.ts
|
|
@@ -7514,7 +7515,7 @@ function satisfies(version, range2) {
|
|
|
7514
7515
|
}
|
|
7515
7516
|
|
|
7516
7517
|
// src/version.ts
|
|
7517
|
-
var KERNEL_VERSION = true ? "1.
|
|
7518
|
+
var KERNEL_VERSION = true ? "1.142.0" : "0.0.0-dev";
|
|
7518
7519
|
var OS_RELEASE = "6.0.0-slicc";
|
|
7519
7520
|
function procVersion() {
|
|
7520
7521
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -31716,7 +31717,7 @@ function nodeTransport(options = {}) {
|
|
|
31716
31717
|
}
|
|
31717
31718
|
var TERMINATED = "the kernel is terminated";
|
|
31718
31719
|
var EXIT_GRACE_MS = 50;
|
|
31719
|
-
function nodeWorker(file, live, closed) {
|
|
31720
|
+
function nodeWorker(file, live, closed, workerData) {
|
|
31720
31721
|
const errors = /* @__PURE__ */ new Set();
|
|
31721
31722
|
const messages = /* @__PURE__ */ new Map();
|
|
31722
31723
|
const fail3 = (message3) => {
|
|
@@ -31725,7 +31726,7 @@ function nodeWorker(file, live, closed) {
|
|
|
31725
31726
|
} });
|
|
31726
31727
|
}
|
|
31727
31728
|
};
|
|
31728
|
-
const worker = closed ? void 0 : new Worker(file);
|
|
31729
|
+
const worker = closed ? void 0 : new Worker(file, { env: workerEnv(), ...workerData ? { workerData } : {} });
|
|
31729
31730
|
let ending = false;
|
|
31730
31731
|
if (worker) {
|
|
31731
31732
|
const kill = () => {
|
|
@@ -31777,6 +31778,17 @@ function cronLock(root) {
|
|
|
31777
31778
|
if (!lock) cronLocks2.set(root, lock = `slicc-kernel-cron:${crypto.randomUUID()}`);
|
|
31778
31779
|
return lock;
|
|
31779
31780
|
}
|
|
31781
|
+
function workerEnv() {
|
|
31782
|
+
const { NODE_COMPILE_CACHE: _inherited, ...env } = process.env;
|
|
31783
|
+
return env;
|
|
31784
|
+
}
|
|
31785
|
+
function cacheDirOf(dir) {
|
|
31786
|
+
if (dir === void 0) return void 0;
|
|
31787
|
+
if (typeof dir !== "string" || !isAbsolute(dir)) {
|
|
31788
|
+
throw new TypeError("createNodeKernel: compileCache must be an absolute directory path");
|
|
31789
|
+
}
|
|
31790
|
+
return dir;
|
|
31791
|
+
}
|
|
31780
31792
|
async function createNodeKernel(options = {}) {
|
|
31781
31793
|
const root = options.root ?? memoryRoot();
|
|
31782
31794
|
const fs = new OpfsFs(root, void 0, void 0, { ranged: isMemoryRoot(root) });
|
|
@@ -31786,11 +31798,12 @@ async function createNodeKernel(options = {}) {
|
|
|
31786
31798
|
const clients = /* @__PURE__ */ new Set();
|
|
31787
31799
|
let terminated = false;
|
|
31788
31800
|
const file = options.worker ?? new URL("./node-process-worker.js", import.meta.url);
|
|
31801
|
+
const compileCache = cacheDirOf(options.compileCache);
|
|
31789
31802
|
const transport = options.network?.transport;
|
|
31790
31803
|
const launcher = new Launcher({
|
|
31791
31804
|
fs,
|
|
31792
31805
|
unlinkOwner: pidOwner(process),
|
|
31793
|
-
createWorker: () => nodeWorker(file, live, terminated),
|
|
31806
|
+
createWorker: () => nodeWorker(file, live, terminated, compileCache ? { compileCache } : void 0),
|
|
31794
31807
|
createDriverWorker: () => nodeWorker(
|
|
31795
31808
|
options.driverWorker ?? new URL("./node-driver-worker.js", import.meta.url),
|
|
31796
31809
|
live,
|