@ai-ecoverse/slicc-kernel 1.160.0 → 1.160.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 +4 -3
- package/dist/kernel-worker.js +33 -7
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-driver-worker.js +8 -0
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +51 -22
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +41 -7
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +38 -22
- package/dist/process-worker.js.map +2 -2
- package/dist/types/kernel/protocol.d.ts +1 -0
- package/dist/types/launcher.d.ts +1 -0
- package/dist/types/node.d.ts +5 -0
- package/dist/types/process/js/js-kernel.d.ts +3 -0
- package/dist/types/realm/sync-fs-wire.d.ts +2 -0
- package/package.json +2 -2
package/dist/process-worker.js
CHANGED
|
@@ -206,7 +206,13 @@ function decodeSabResult(status2, payload) {
|
|
|
206
206
|
const parsed = capturedJSON.parse(decoder.decode(payload));
|
|
207
207
|
const errno2 = typeof parsed.errno === "string" && /^E[A-Z]+$|^EAI_[A-Z]+$/.test(parsed.errno) ? parsed.errno : "EIO";
|
|
208
208
|
const message2 = capturedString(parsed.message ?? errno2);
|
|
209
|
-
return
|
|
209
|
+
return {
|
|
210
|
+
ok: false,
|
|
211
|
+
errno: errno2,
|
|
212
|
+
message: message2,
|
|
213
|
+
...parsed.direct === true ? { direct: true } : {},
|
|
214
|
+
...typeof parsed.dev === "string" ? { dev: parsed.dev } : {}
|
|
215
|
+
};
|
|
210
216
|
} catch {
|
|
211
217
|
return { ok: false, errno: "EIO", message: "sync-sab: malformed errno payload" };
|
|
212
218
|
}
|
|
@@ -3052,7 +3058,7 @@ var init_version = __esm({
|
|
|
3052
3058
|
"src/version.ts"() {
|
|
3053
3059
|
"use strict";
|
|
3054
3060
|
init_captured_globals();
|
|
3055
|
-
KERNEL_VERSION = true ? "1.160.
|
|
3061
|
+
KERNEL_VERSION = true ? "1.160.2" : "0.0.0-dev";
|
|
3056
3062
|
OS_RELEASE = "6.0.0-slicc";
|
|
3057
3063
|
}
|
|
3058
3064
|
});
|
|
@@ -7991,6 +7997,10 @@ var init_async_sab = __esm({
|
|
|
7991
7997
|
});
|
|
7992
7998
|
|
|
7993
7999
|
// src/process/js/js-kernel.ts
|
|
8000
|
+
function devOf(found) {
|
|
8001
|
+
const dev = found?.dev;
|
|
8002
|
+
return typeof dev === "string" ? dev : void 0;
|
|
8003
|
+
}
|
|
7994
8004
|
function umaskRequest(mask) {
|
|
7995
8005
|
if (mask === void 0) return { op: "proc-umask" };
|
|
7996
8006
|
if (!capturedNumber.isInteger(mask) || mask < 0 || mask > 511) {
|
|
@@ -8007,11 +8017,13 @@ function modeOf(mode) {
|
|
|
8007
8017
|
function callError(result, op) {
|
|
8008
8018
|
const { errno: errno2, message: message2 } = result;
|
|
8009
8019
|
const detailed = typeof message2 === "string" && message2 !== errno2 && DETAILED.has(op);
|
|
8010
|
-
|
|
8020
|
+
const err = new JsCallError(
|
|
8011
8021
|
errno2,
|
|
8012
8022
|
detailed ? `${op}: ${message2}` : op,
|
|
8013
8023
|
detailed ? message2 : void 0
|
|
8014
8024
|
);
|
|
8025
|
+
err.dev = result.dev;
|
|
8026
|
+
return err;
|
|
8015
8027
|
}
|
|
8016
8028
|
function untilAborted(work, signal) {
|
|
8017
8029
|
if (!signal) return work;
|
|
@@ -8040,6 +8052,7 @@ var init_js_kernel = __esm({
|
|
|
8040
8052
|
JsCallError = class extends capturedError {
|
|
8041
8053
|
code;
|
|
8042
8054
|
detail;
|
|
8055
|
+
dev;
|
|
8043
8056
|
constructor(code2, what, detail) {
|
|
8044
8057
|
super(`${what}: ${code2}`);
|
|
8045
8058
|
this.name = "JsCallError";
|
|
@@ -17695,12 +17708,12 @@ function syncOps(kernel, shared) {
|
|
|
17695
17708
|
if (inDev(abs)) return devSync(kernel, devStat(abs, op === "stat"));
|
|
17696
17709
|
try {
|
|
17697
17710
|
if (!clean()) kernel.call({ op: "fd-path-flush", path: abs });
|
|
17698
|
-
const s = parseSyncFsStat(kernel.json({ op, path: abs }));
|
|
17711
|
+
const s = parseSyncFsStat(kernel.json({ op, path: abs, devs: true }));
|
|
17699
17712
|
if (!s) throw new JsCallError("EIO", op);
|
|
17700
17713
|
return s;
|
|
17701
17714
|
} catch (err) {
|
|
17702
17715
|
if (!(err instanceof JsCallError) || err.code !== "ENOENT") throw err;
|
|
17703
|
-
const devPath =
|
|
17716
|
+
const devPath = err.dev;
|
|
17704
17717
|
if (!devPath) throw err;
|
|
17705
17718
|
return devSync(kernel, devStat(devPath, op === "stat"));
|
|
17706
17719
|
}
|
|
@@ -17771,7 +17784,7 @@ function syncOps(kernel, shared) {
|
|
|
17771
17784
|
},
|
|
17772
17785
|
pipe: () => kernel.json({ op: "fd-pipe" }),
|
|
17773
17786
|
open: procOpenSync(open, kernel, { resolve, pid: shared.pid }),
|
|
17774
|
-
fs: procFsSync(syncPathOps(kernel, resolve, statOf, open,
|
|
17787
|
+
fs: procFsSync(syncPathOps(kernel, resolve, statOf, open, clean), kernel, {
|
|
17775
17788
|
resolve,
|
|
17776
17789
|
pid: shared.pid
|
|
17777
17790
|
})
|
|
@@ -17848,15 +17861,16 @@ function syncFile(kernel, fd, path, append, forget) {
|
|
|
17848
17861
|
}
|
|
17849
17862
|
};
|
|
17850
17863
|
}
|
|
17851
|
-
function syncPathOps(kernel, resolve, statOf, open,
|
|
17864
|
+
function syncPathOps(kernel, resolve, statOf, open, clean) {
|
|
17852
17865
|
return {
|
|
17853
17866
|
stat: (path) => statOf("stat", path),
|
|
17854
17867
|
lstat: (path) => statOf("lstat", path),
|
|
17855
17868
|
exists(path) {
|
|
17856
17869
|
const abs = resolve(path);
|
|
17857
17870
|
if (inDev(abs)) return devSync(kernel, devExists(abs));
|
|
17858
|
-
|
|
17859
|
-
|
|
17871
|
+
const found = kernel.json({ op: "exists", path: abs, devs: true });
|
|
17872
|
+
if (found === true) return true;
|
|
17873
|
+
const devPath = devOf(found);
|
|
17860
17874
|
return devPath ? devSync(kernel, devExists(devPath)) : false;
|
|
17861
17875
|
},
|
|
17862
17876
|
readdir(path) {
|
|
@@ -17898,10 +17912,10 @@ function syncPathOps(kernel, resolve, statOf, open, tryDev, clean) {
|
|
|
17898
17912
|
if (inDev(abs)) return readWholeSync(open(abs));
|
|
17899
17913
|
try {
|
|
17900
17914
|
if (!clean()) kernel.call({ op: "fd-path-flush", path: abs });
|
|
17901
|
-
return kernel.bytes({ op: "read", path: abs });
|
|
17915
|
+
return kernel.bytes({ op: "read", path: abs, devs: true });
|
|
17902
17916
|
} catch (err) {
|
|
17903
17917
|
if (!(err instanceof JsCallError) || err.code !== "ENOENT") throw err;
|
|
17904
|
-
const devPath =
|
|
17918
|
+
const devPath = err.dev;
|
|
17905
17919
|
if (!devPath) throw err;
|
|
17906
17920
|
return readWholeSync(open(devPath));
|
|
17907
17921
|
}
|
|
@@ -18729,15 +18743,15 @@ async function resolveDevAsync(kernel, abs) {
|
|
|
18729
18743
|
return void 0;
|
|
18730
18744
|
}
|
|
18731
18745
|
}
|
|
18732
|
-
async function vfsStat(kernel, abs, op,
|
|
18746
|
+
async function vfsStat(kernel, abs, op, clean) {
|
|
18733
18747
|
try {
|
|
18734
18748
|
if (!clean()) await kernel.call({ op: "fd-path-flush", path: abs });
|
|
18735
|
-
const s = parseSyncFsStat(await kernel.json({ op, path: abs }));
|
|
18749
|
+
const s = parseSyncFsStat(await kernel.json({ op, path: abs, devs: true }));
|
|
18736
18750
|
if (!s) throw new JsCallError("EIO", op);
|
|
18737
18751
|
return s;
|
|
18738
18752
|
} catch (err) {
|
|
18739
18753
|
if (!(err instanceof JsCallError) || err.code !== "ENOENT") throw err;
|
|
18740
|
-
const devPath =
|
|
18754
|
+
const devPath = err.dev;
|
|
18741
18755
|
if (!devPath) throw err;
|
|
18742
18756
|
return devAsync(kernel, devStat(devPath, op === "stat"));
|
|
18743
18757
|
}
|
|
@@ -18966,7 +18980,7 @@ function createContext(o) {
|
|
|
18966
18980
|
const statOf = async (op, path) => {
|
|
18967
18981
|
const abs = resolve(path);
|
|
18968
18982
|
if (inDev(abs)) return devAsync(kernel, devStat(abs, op === "stat"));
|
|
18969
|
-
return vfsStat(kernel, abs, op,
|
|
18983
|
+
return vfsStat(kernel, abs, op, clean);
|
|
18970
18984
|
};
|
|
18971
18985
|
const devIo = { infos, handles, read: read2, write: writeAll };
|
|
18972
18986
|
const open = async (path, options = {}, whole = false) => {
|
|
@@ -18981,7 +18995,7 @@ function createContext(o) {
|
|
|
18981
18995
|
return openDev(kernel, devPath, options, devIo);
|
|
18982
18996
|
}
|
|
18983
18997
|
};
|
|
18984
|
-
const fs = procFsAsync(pathOps(kernel, resolve, statOf, open,
|
|
18998
|
+
const fs = procFsAsync(pathOps(kernel, resolve, statOf, open, clean), kernel, {
|
|
18985
18999
|
resolve,
|
|
18986
19000
|
pid: o.pid
|
|
18987
19001
|
});
|
|
@@ -19197,15 +19211,16 @@ async function sendSome(kernel, fd, body, signal) {
|
|
|
19197
19211
|
await kernel.blocking({ op: "fd-select", read: [], write: [fd], timeoutMs: -1 }, signal);
|
|
19198
19212
|
}
|
|
19199
19213
|
}
|
|
19200
|
-
function pathOps(kernel, resolve, statOf, open,
|
|
19214
|
+
function pathOps(kernel, resolve, statOf, open, clean) {
|
|
19201
19215
|
return {
|
|
19202
19216
|
stat: (path) => statOf("stat", path),
|
|
19203
19217
|
lstat: (path) => statOf("lstat", path),
|
|
19204
19218
|
async exists(path) {
|
|
19205
19219
|
const abs = resolve(path);
|
|
19206
19220
|
if (inDev(abs)) return devAsync(kernel, devExists(abs));
|
|
19207
|
-
|
|
19208
|
-
|
|
19221
|
+
const found = await kernel.json({ op: "exists", path: abs, devs: true });
|
|
19222
|
+
if (found === true) return true;
|
|
19223
|
+
const devPath = devOf(found);
|
|
19209
19224
|
return devPath ? devAsync(kernel, devExists(devPath)) : false;
|
|
19210
19225
|
},
|
|
19211
19226
|
async readdir(path) {
|
|
@@ -19249,10 +19264,10 @@ function pathOps(kernel, resolve, statOf, open, tryDev, clean) {
|
|
|
19249
19264
|
if (inDev(abs)) return readWhole(await open(abs));
|
|
19250
19265
|
try {
|
|
19251
19266
|
if (!clean()) await kernel.call({ op: "fd-path-flush", path: abs });
|
|
19252
|
-
return await kernel.bytes({ op: "read", path: abs });
|
|
19267
|
+
return await kernel.bytes({ op: "read", path: abs, devs: true });
|
|
19253
19268
|
} catch (err) {
|
|
19254
19269
|
if (!(err instanceof JsCallError) || err.code !== "ENOENT") throw err;
|
|
19255
|
-
const devPath =
|
|
19270
|
+
const devPath = err.dev;
|
|
19256
19271
|
if (!devPath) throw err;
|
|
19257
19272
|
return readWhole(await open(devPath));
|
|
19258
19273
|
}
|
|
@@ -19518,7 +19533,8 @@ async function runJs(init, port2, deps, thread) {
|
|
|
19518
19533
|
});
|
|
19519
19534
|
try {
|
|
19520
19535
|
(deps.lockdown ?? lockdown)();
|
|
19521
|
-
const { url, glue } = init.program;
|
|
19536
|
+
const { url, glue, source } = init.program;
|
|
19537
|
+
if (url && source !== void 0) deps.moduleSource?.(url, source);
|
|
19522
19538
|
main = mainOf(await (url ? import(url) : (deps.load ?? importSource)(glue)));
|
|
19523
19539
|
deps.imported?.();
|
|
19524
19540
|
} catch (err) {
|