@ai-ecoverse/slicc-kernel 1.99.1 → 1.99.2
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 +29 -0
- package/dist/kernel-worker.js +17 -10
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +17 -10
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +1 -1
- package/package.json +2 -2
|
@@ -4650,7 +4650,7 @@ var KERNEL_VERSION, OS_RELEASE;
|
|
|
4650
4650
|
var init_version = __esm({
|
|
4651
4651
|
"src/version.ts"() {
|
|
4652
4652
|
"use strict";
|
|
4653
|
-
KERNEL_VERSION = true ? "1.99.
|
|
4653
|
+
KERNEL_VERSION = true ? "1.99.2" : "0.0.0-dev";
|
|
4654
4654
|
OS_RELEASE = "6.0.0-slicc";
|
|
4655
4655
|
}
|
|
4656
4656
|
});
|
package/dist/node.js
CHANGED
|
@@ -8284,12 +8284,18 @@ var DriverConnection = class _DriverConnection {
|
|
|
8284
8284
|
timeoutMs;
|
|
8285
8285
|
nextId = 0;
|
|
8286
8286
|
onFail;
|
|
8287
|
-
|
|
8287
|
+
idle;
|
|
8288
|
+
constructor(port, capabilities, waiting, timeoutMs, options) {
|
|
8288
8289
|
this.port = port;
|
|
8289
8290
|
this.capabilities = capabilities;
|
|
8290
8291
|
this.waiting = waiting;
|
|
8291
8292
|
this.timeoutMs = timeoutMs;
|
|
8292
|
-
this.onFail = onFail;
|
|
8293
|
+
this.onFail = options.onFail;
|
|
8294
|
+
this.idle = options.idle === true;
|
|
8295
|
+
if (this.idle) port.unref?.();
|
|
8296
|
+
}
|
|
8297
|
+
settled() {
|
|
8298
|
+
if (this.idle && this.waiting.size === 0) this.port.unref?.();
|
|
8293
8299
|
}
|
|
8294
8300
|
static async open(port, mount, options = {}) {
|
|
8295
8301
|
const timeoutMs = options.timeoutMs ?? DRIVER_TIMEOUT_MS;
|
|
@@ -8305,6 +8311,7 @@ var DriverConnection = class _DriverConnection {
|
|
|
8305
8311
|
clearTimeout(call.timer);
|
|
8306
8312
|
if (data.errno) call.reject(errnoError(data.errno, data.message ?? data.errno));
|
|
8307
8313
|
else call.resolve(data.result);
|
|
8314
|
+
if (options.idle && waiting.size === 0) port.unref?.();
|
|
8308
8315
|
});
|
|
8309
8316
|
port.start?.();
|
|
8310
8317
|
port.postMessage({ hello: { protocol: DRIVER_PROTOCOL, mount } });
|
|
@@ -8323,7 +8330,7 @@ var DriverConnection = class _DriverConnection {
|
|
|
8323
8330
|
const refused2 = driverVersionError(hello.protocol);
|
|
8324
8331
|
if (refused2) throw errnoError("EPROTO", refused2);
|
|
8325
8332
|
if (hello.error) throw errnoError(hello.errno ?? "EIO", hello.error);
|
|
8326
|
-
return new _DriverConnection(port, hello.capabilities ?? {}, waiting, timeoutMs, options
|
|
8333
|
+
return new _DriverConnection(port, hello.capabilities ?? {}, waiting, timeoutMs, options);
|
|
8327
8334
|
}
|
|
8328
8335
|
call(call, transfer = []) {
|
|
8329
8336
|
if (this.failure) return Promise.reject(this.failure);
|
|
@@ -8332,6 +8339,7 @@ var DriverConnection = class _DriverConnection {
|
|
|
8332
8339
|
const timer = unref(
|
|
8333
8340
|
setTimeout(() => {
|
|
8334
8341
|
this.waiting.delete(id2);
|
|
8342
|
+
this.settled();
|
|
8335
8343
|
const error = errnoError(
|
|
8336
8344
|
"EIO",
|
|
8337
8345
|
`the driver did not answer ${call.op} within ${this.timeoutMs} ms`
|
|
@@ -8341,6 +8349,7 @@ var DriverConnection = class _DriverConnection {
|
|
|
8341
8349
|
this.onFail?.(error);
|
|
8342
8350
|
}, this.timeoutMs)
|
|
8343
8351
|
);
|
|
8352
|
+
if (this.idle && this.waiting.size === 0) this.port.ref?.();
|
|
8344
8353
|
this.waiting.set(id2, { resolve: resolve2, reject, timer });
|
|
8345
8354
|
this.port.postMessage({ ...call, id: id2 }, transfer);
|
|
8346
8355
|
});
|
|
@@ -8353,6 +8362,7 @@ var DriverConnection = class _DriverConnection {
|
|
|
8353
8362
|
call.reject(error);
|
|
8354
8363
|
}
|
|
8355
8364
|
this.waiting.clear();
|
|
8365
|
+
this.settled();
|
|
8356
8366
|
}
|
|
8357
8367
|
close() {
|
|
8358
8368
|
this.fail(errnoError("EIO", "the file system is unmounted"));
|
|
@@ -8707,6 +8717,7 @@ var MountTable = class {
|
|
|
8707
8717
|
{ source: spec.source, options },
|
|
8708
8718
|
{
|
|
8709
8719
|
...this.deps.timeoutMs ? { timeoutMs: this.deps.timeoutMs } : {},
|
|
8720
|
+
...opened2.idle ? { idle: true } : {},
|
|
8710
8721
|
onInvalidate: (paths) => this.invalidated(target, paths),
|
|
8711
8722
|
onFail: (error) => {
|
|
8712
8723
|
if (mounted) this.crashed(mounted, error);
|
|
@@ -11089,7 +11100,7 @@ var PATH_OPS = new Set(SYNC_FS_OPS);
|
|
|
11089
11100
|
var EARLY_WHOLE_FILE = 64 * 1024;
|
|
11090
11101
|
|
|
11091
11102
|
// src/version.ts
|
|
11092
|
-
var KERNEL_VERSION = true ? "1.99.
|
|
11103
|
+
var KERNEL_VERSION = true ? "1.99.2" : "0.0.0-dev";
|
|
11093
11104
|
var OS_RELEASE = "6.0.0-slicc";
|
|
11094
11105
|
function procVersion() {
|
|
11095
11106
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -20318,9 +20329,6 @@ var NOT_EXECUTABLE = 126;
|
|
|
20318
20329
|
var DECIDE_MS = 100;
|
|
20319
20330
|
var INIT_PID = 1;
|
|
20320
20331
|
var SHARED_DIRS = ["/tmp", "/home"];
|
|
20321
|
-
function unref2(port) {
|
|
20322
|
-
port.unref?.();
|
|
20323
|
-
}
|
|
20324
20332
|
var LAYOUT = [
|
|
20325
20333
|
["/", 493],
|
|
20326
20334
|
["/root", 448],
|
|
@@ -20531,7 +20539,6 @@ var Launcher = class {
|
|
|
20531
20539
|
pnpmMade;
|
|
20532
20540
|
pnpmEpoch = 0;
|
|
20533
20541
|
mounts;
|
|
20534
|
-
shmPorts = [];
|
|
20535
20542
|
createDriverWorker;
|
|
20536
20543
|
media;
|
|
20537
20544
|
onMountPending;
|
|
@@ -21796,9 +21803,10 @@ var Launcher = class {
|
|
|
21796
21803
|
},
|
|
21797
21804
|
{ owned: true }
|
|
21798
21805
|
);
|
|
21799
|
-
if (spec.target === SHM)
|
|
21806
|
+
if (spec.target === SHM) port2.unref?.();
|
|
21800
21807
|
return {
|
|
21801
21808
|
port: port1,
|
|
21809
|
+
...spec.target === SHM ? { idle: true } : {},
|
|
21802
21810
|
dispose: () => {
|
|
21803
21811
|
port1.close();
|
|
21804
21812
|
port2.close();
|
|
@@ -21902,7 +21910,6 @@ var Launcher = class {
|
|
|
21902
21910
|
async mountShm() {
|
|
21903
21911
|
await this.base.mkdir(SHM, { recursive: true });
|
|
21904
21912
|
await this.mounts.mountSystem({ type: "tmpfs", source: "shm", target: SHM }, this.fs);
|
|
21905
|
-
for (const port of this.shmPorts) unref2(port);
|
|
21906
21913
|
await this.fs.chmod(SHM, 1023);
|
|
21907
21914
|
}
|
|
21908
21915
|
async ownTmp() {
|