@ai-ecoverse/slicc-kernel 1.139.1 → 1.140.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 +1 -1
- package/dist/kernel-worker.js +79 -14
- package/dist/kernel-worker.js.map +4 -4
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +76 -11
- package/dist/node.js.map +4 -4
- package/dist/process-worker.js +1 -1
- package/dist/types/fs/etc-files.d.ts +3 -0
- package/package.json +1 -1
|
@@ -6710,7 +6710,7 @@ var KERNEL_VERSION, OS_RELEASE;
|
|
|
6710
6710
|
var init_version = __esm({
|
|
6711
6711
|
"src/version.ts"() {
|
|
6712
6712
|
"use strict";
|
|
6713
|
-
KERNEL_VERSION = true ? "1.
|
|
6713
|
+
KERNEL_VERSION = true ? "1.140.0" : "0.0.0-dev";
|
|
6714
6714
|
OS_RELEASE = "6.0.0-slicc";
|
|
6715
6715
|
}
|
|
6716
6716
|
});
|
package/dist/node.js
CHANGED
|
@@ -7513,7 +7513,7 @@ function satisfies(version, range2) {
|
|
|
7513
7513
|
}
|
|
7514
7514
|
|
|
7515
7515
|
// src/version.ts
|
|
7516
|
-
var KERNEL_VERSION = true ? "1.
|
|
7516
|
+
var KERNEL_VERSION = true ? "1.140.0" : "0.0.0-dev";
|
|
7517
7517
|
var OS_RELEASE = "6.0.0-slicc";
|
|
7518
7518
|
function procVersion() {
|
|
7519
7519
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -9815,6 +9815,70 @@ function devCreation(path, cred) {
|
|
|
9815
9815
|
return cred && cred.euid !== 0 ? "EACCES" : "EPERM";
|
|
9816
9816
|
}
|
|
9817
9817
|
|
|
9818
|
+
// src/fs/etc-files.ts
|
|
9819
|
+
var HOSTNAME_PATH = "/etc/hostname";
|
|
9820
|
+
var S_IFREG3 = 32768;
|
|
9821
|
+
function missing4(err) {
|
|
9822
|
+
return err?.code === "ENOENT";
|
|
9823
|
+
}
|
|
9824
|
+
function statOf(path, bytes) {
|
|
9825
|
+
const epoch = /* @__PURE__ */ new Date(0);
|
|
9826
|
+
return {
|
|
9827
|
+
isFile: true,
|
|
9828
|
+
isDirectory: false,
|
|
9829
|
+
isSymbolicLink: false,
|
|
9830
|
+
size: bytes.length,
|
|
9831
|
+
mode: S_IFREG3 | 420,
|
|
9832
|
+
mtime: epoch,
|
|
9833
|
+
atime: epoch,
|
|
9834
|
+
ctime: epoch,
|
|
9835
|
+
ino: inodeOf(path),
|
|
9836
|
+
nlink: 1,
|
|
9837
|
+
uid: 0,
|
|
9838
|
+
gid: 0
|
|
9839
|
+
};
|
|
9840
|
+
}
|
|
9841
|
+
function withEtcFiles(fs, files) {
|
|
9842
|
+
const bytesOf4 = (path) => {
|
|
9843
|
+
const text = files.get(path)?.();
|
|
9844
|
+
return text === void 0 ? void 0 : new TextEncoder().encode(text);
|
|
9845
|
+
};
|
|
9846
|
+
const absent2 = (path) => fs.lstat(path).then(() => false, missing4);
|
|
9847
|
+
const fallback = (path, make) => async (err) => {
|
|
9848
|
+
const bytes = missing4(err) && files.has(path) && await absent2(path) ? bytesOf4(path) : void 0;
|
|
9849
|
+
if (bytes === void 0) throw err;
|
|
9850
|
+
return make(bytes);
|
|
9851
|
+
};
|
|
9852
|
+
const ranged2 = rangedOps(fs);
|
|
9853
|
+
const own = {
|
|
9854
|
+
stat: (path) => fs.stat(path).catch(fallback(path, (b) => statOf(path, b))),
|
|
9855
|
+
lstat: (path) => fs.lstat(path).catch(fallback(path, (b) => statOf(path, b))),
|
|
9856
|
+
exists: async (path) => await fs.exists(path) || files.has(path) && await absent2(path),
|
|
9857
|
+
...fs.createExclusive ? {
|
|
9858
|
+
createExclusive: async (path, owner) => {
|
|
9859
|
+
if (files.has(path) && await absent2(path)) throw fsError("EEXIST", path);
|
|
9860
|
+
return fs.createExclusive.call(
|
|
9861
|
+
fs,
|
|
9862
|
+
path,
|
|
9863
|
+
owner
|
|
9864
|
+
);
|
|
9865
|
+
}
|
|
9866
|
+
} : {},
|
|
9867
|
+
readFile: (path) => fs.readFile(path).catch(fallback(path, (b) => new TextDecoder().decode(b))),
|
|
9868
|
+
readFileBuffer: (path) => fs.readFileBuffer(path).catch(fallback(path, (b) => b)),
|
|
9869
|
+
...ranged2 ? {
|
|
9870
|
+
pread: (path, offset, length2, version) => ranged2.pread(path, offset, length2, version).catch(fallback(path, (b) => b.slice(offset, offset + length2)))
|
|
9871
|
+
} : {}
|
|
9872
|
+
};
|
|
9873
|
+
return new Proxy(fs, {
|
|
9874
|
+
get(target, key, receiver) {
|
|
9875
|
+
if (Object.hasOwn(own, key)) return own[key];
|
|
9876
|
+
const value2 = Reflect.get(target, key, receiver);
|
|
9877
|
+
return typeof value2 === "function" ? value2.bind(target) : value2;
|
|
9878
|
+
}
|
|
9879
|
+
});
|
|
9880
|
+
}
|
|
9881
|
+
|
|
9818
9882
|
// src/fs/fresh-modules.ts
|
|
9819
9883
|
var MAGIC = [0, 97, 115, 109];
|
|
9820
9884
|
var MAX_FRESH = 65536;
|
|
@@ -11270,7 +11334,7 @@ function inodeless(mount, attr2) {
|
|
|
11270
11334
|
if (mount.caps.links) mount.caps = { ...mount.caps, links: false };
|
|
11271
11335
|
return true;
|
|
11272
11336
|
}
|
|
11273
|
-
function
|
|
11337
|
+
function statOf2(attr2, path, mount) {
|
|
11274
11338
|
const mtime = new Date(attr2.mtime);
|
|
11275
11339
|
const fallback = attr2.kind === "directory" ? 16877 : attr2.kind === "symlink" ? 41471 : attr2.kind === "fifo" ? 4516 : 33188;
|
|
11276
11340
|
return {
|
|
@@ -11742,7 +11806,7 @@ var MountFs = class _MountFs {
|
|
|
11742
11806
|
const { mount, rel: rel2 } = found;
|
|
11743
11807
|
if (!owner || !mount.owners || !mount.caps.owners) return void 0;
|
|
11744
11808
|
const dir = parentOf7(real);
|
|
11745
|
-
const above =
|
|
11809
|
+
const above = statOf2(await this.table.getattr(mount, dir, parentOf7(rel2)), dir, mount);
|
|
11746
11810
|
const setgid = (above.mode & S_ISGID4) !== 0;
|
|
11747
11811
|
let mode = owner.mode;
|
|
11748
11812
|
if (directory && setgid) mode = (mode ?? 493) | S_ISGID4;
|
|
@@ -12074,7 +12138,7 @@ var MountFs = class _MountFs {
|
|
|
12074
12138
|
}
|
|
12075
12139
|
statWriting(attr2, real, mount) {
|
|
12076
12140
|
const ends = (this.table.writing(real)?.extents ?? []).map(([, end]) => end);
|
|
12077
|
-
return
|
|
12141
|
+
return statOf2({ ...attr2, size: Math.max(attr2.size, ...ends) }, real, mount);
|
|
12078
12142
|
}
|
|
12079
12143
|
async stat(path, redirects = 0) {
|
|
12080
12144
|
const real = await this.follow(path);
|
|
@@ -15485,11 +15549,11 @@ function ipv6(host) {
|
|
|
15485
15549
|
const back = halves.length === 2 ? groups(halves[1]) : [];
|
|
15486
15550
|
if (![...head, ...back].every((g) => /^[0-9A-Fa-f]{1,4}$/.test(g))) return void 0;
|
|
15487
15551
|
const words2 = [...head, ...back].map((g) => Number.parseInt(g, 16));
|
|
15488
|
-
const
|
|
15489
|
-
if (halves.length === 2 ?
|
|
15552
|
+
const missing5 = 8 - words2.length - tail2.length;
|
|
15553
|
+
if (halves.length === 2 ? missing5 < 1 : missing5 !== 0) return void 0;
|
|
15490
15554
|
const all = [
|
|
15491
15555
|
...head.map((g) => Number.parseInt(g, 16)),
|
|
15492
|
-
...new Array(halves.length === 2 ?
|
|
15556
|
+
...new Array(halves.length === 2 ? missing5 : 0).fill(0),
|
|
15493
15557
|
...back.map((g) => Number.parseInt(g, 16)),
|
|
15494
15558
|
...tail2
|
|
15495
15559
|
];
|
|
@@ -27806,13 +27870,13 @@ function interpreter(head) {
|
|
|
27806
27870
|
function expandDefaults(defaults2, env) {
|
|
27807
27871
|
const out = {};
|
|
27808
27872
|
for (const [key, value2] of Object.entries(defaults2 ?? {})) {
|
|
27809
|
-
let
|
|
27873
|
+
let missing5 = false;
|
|
27810
27874
|
const expanded = value2.replace(ENV_REFERENCE, (_, name2) => {
|
|
27811
27875
|
const set3 = Object.hasOwn(env, name2) ? env[name2] : void 0;
|
|
27812
|
-
if (set3 === void 0)
|
|
27876
|
+
if (set3 === void 0) missing5 = true;
|
|
27813
27877
|
return set3 ?? "";
|
|
27814
27878
|
});
|
|
27815
|
-
if (!
|
|
27879
|
+
if (!missing5) out[key] = expanded;
|
|
27816
27880
|
}
|
|
27817
27881
|
return out;
|
|
27818
27882
|
}
|
|
@@ -29983,7 +30047,8 @@ var Launcher = class {
|
|
|
29983
30047
|
}
|
|
29984
30048
|
commandFs(root) {
|
|
29985
30049
|
return withCommandDirs(
|
|
29986
|
-
root,
|
|
30050
|
+
withEtcFiles(root, /* @__PURE__ */ new Map([[HOSTNAME_PATH, () => `${this.hostname}
|
|
30051
|
+
`]])),
|
|
29987
30052
|
async () => this.commandNames(await this.commands()),
|
|
29988
30053
|
(dir) => this.userCommandDir(dir),
|
|
29989
30054
|
this.owners,
|