@ai-ecoverse/slicc-kernel 1.175.1 → 1.176.1
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 +6 -5
- package/dist/driver-worker.js +2 -1
- package/dist/driver-worker.js.map +2 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +2 -2
- package/dist/kernel-worker.js +53 -8
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-driver-worker.js +2 -1
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.cjs +84 -19
- package/dist/node-process-worker.cjs.map +3 -3
- package/dist/node-process-worker.js +84 -19
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +54 -9
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +84 -19
- package/dist/process-worker.js.map +3 -3
- package/dist/types/fs/dac.d.ts +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/kernel/embedder.d.ts +3 -0
- package/dist/types/realm/live-vfs-fs.d.ts +5 -0
- package/dist/types/serve.d.ts +5 -0
- package/dist/types/users.d.ts +5 -1
- package/package.json +3 -3
|
@@ -2072,6 +2072,9 @@ function normalizePath(path) {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
return `/${parts.join("/")}`;
|
|
2074
2074
|
}
|
|
2075
|
+
function resolvePath(base, path) {
|
|
2076
|
+
return normalizePath(path.startsWith("/") ? path : `${base}/${path}`);
|
|
2077
|
+
}
|
|
2075
2078
|
function inodeOf(path) {
|
|
2076
2079
|
let h1 = 3735928559;
|
|
2077
2080
|
let h2 = 1103547991;
|
|
@@ -7514,7 +7517,7 @@ var init_version = __esm({
|
|
|
7514
7517
|
"src/version.ts"() {
|
|
7515
7518
|
"use strict";
|
|
7516
7519
|
init_captured_globals();
|
|
7517
|
-
KERNEL_VERSION = true ? "1.
|
|
7520
|
+
KERNEL_VERSION = true ? "1.176.1" : "0.0.0-dev";
|
|
7518
7521
|
OS_RELEASE = "6.0.0-slicc";
|
|
7519
7522
|
}
|
|
7520
7523
|
});
|
|
@@ -9964,6 +9967,7 @@ function liveRoot(Fs, bridge) {
|
|
|
9964
9967
|
plugin.mounts.add(root.mount);
|
|
9965
9968
|
invalidateLiveVfs(Fs, plugin);
|
|
9966
9969
|
guardRenames(Fs);
|
|
9970
|
+
guardCreateParents(Fs, bridge);
|
|
9967
9971
|
guardKeptNodes(Fs, plugin.handled);
|
|
9968
9972
|
guardStaleNodes(Fs, plugin);
|
|
9969
9973
|
guardVanished(Fs);
|
|
@@ -10121,6 +10125,62 @@ function guardRenames(Fs) {
|
|
|
10121
10125
|
rename(from, to);
|
|
10122
10126
|
};
|
|
10123
10127
|
}
|
|
10128
|
+
function createParentRefreshCount() {
|
|
10129
|
+
return createParentRefresh;
|
|
10130
|
+
}
|
|
10131
|
+
function aboveOf(path) {
|
|
10132
|
+
const norm = path.replace(/\/+$/, "") || "/";
|
|
10133
|
+
if (norm === "/") return "/";
|
|
10134
|
+
const slash = norm.lastIndexOf("/");
|
|
10135
|
+
const parent = slash <= 0 ? "/" : norm.slice(0, slash);
|
|
10136
|
+
if (parent === "/") return "/";
|
|
10137
|
+
const above = parent.lastIndexOf("/");
|
|
10138
|
+
return above <= 0 ? "/" : parent.slice(0, above);
|
|
10139
|
+
}
|
|
10140
|
+
function absoluteCreatePath(Fs, path) {
|
|
10141
|
+
if (typeof path !== "string" || path.length === 0) return void 0;
|
|
10142
|
+
if (path.startsWith("/")) return normalizePath(path);
|
|
10143
|
+
const cwd = Fs.cwd?.();
|
|
10144
|
+
if (typeof cwd !== "string") return void 0;
|
|
10145
|
+
return resolvePath(cwd, path);
|
|
10146
|
+
}
|
|
10147
|
+
function refreshCreateParent(Fs, bridge, path) {
|
|
10148
|
+
const abs = absoluteCreatePath(Fs, path);
|
|
10149
|
+
if (abs === void 0) return;
|
|
10150
|
+
createParentRefresh++;
|
|
10151
|
+
try {
|
|
10152
|
+
bridge.readdir(aboveOf(abs));
|
|
10153
|
+
} catch {
|
|
10154
|
+
}
|
|
10155
|
+
}
|
|
10156
|
+
function oncePastStaleParent(Fs, bridge, path, op) {
|
|
10157
|
+
try {
|
|
10158
|
+
return op();
|
|
10159
|
+
} catch (err) {
|
|
10160
|
+
if (err.errno !== wasiErrno("ENOENT")) throw err;
|
|
10161
|
+
refreshCreateParent(Fs, bridge, path);
|
|
10162
|
+
return op();
|
|
10163
|
+
}
|
|
10164
|
+
}
|
|
10165
|
+
function guardCreateParents(Fs, bridge) {
|
|
10166
|
+
if (Fs.sliccCreateParent) return;
|
|
10167
|
+
Fs.sliccCreateParent = true;
|
|
10168
|
+
const mkdir = Fs.mkdir?.bind(Fs);
|
|
10169
|
+
if (mkdir) {
|
|
10170
|
+
Fs.mkdir = (path, mode) => oncePastStaleParent(Fs, bridge, path, () => mkdir(path, mode));
|
|
10171
|
+
}
|
|
10172
|
+
const symlink = Fs.symlink?.bind(Fs);
|
|
10173
|
+
if (symlink) {
|
|
10174
|
+
Fs.symlink = (target, path) => oncePastStaleParent(Fs, bridge, path, () => symlink(target, path));
|
|
10175
|
+
}
|
|
10176
|
+
const open = Fs.open?.bind(Fs);
|
|
10177
|
+
if (open) {
|
|
10178
|
+
Fs.open = (path, flags, mode) => {
|
|
10179
|
+
if ((flags & O_CREAT) === 0) return open(path, flags, mode);
|
|
10180
|
+
return oncePastStaleParent(Fs, bridge, path, () => open(path, flags, mode));
|
|
10181
|
+
};
|
|
10182
|
+
}
|
|
10183
|
+
}
|
|
10124
10184
|
function idOf3(value2) {
|
|
10125
10185
|
return value2 === -1 || value2 === 4294967295 ? void 0 : value2 >>> 0;
|
|
10126
10186
|
}
|
|
@@ -10225,7 +10285,7 @@ function readingLinks(Fs) {
|
|
|
10225
10285
|
}
|
|
10226
10286
|
};
|
|
10227
10287
|
}
|
|
10228
|
-
var S_IFDIR, S_IFREG, S_IFLNK2, S_IFSOCK, S_IFIFO2, S_IFMT2, PERM_MASK, DEFAULT_DIR_PERM, UMASK2, SEEK_CUR2, SEEK_END2, EARLY_WHOLE_FILE, O_APPEND4, O_ACCMODE, O_TRUNC, O_PATH, stale, opening, O_NOFOLLOW, RESOLVING;
|
|
10288
|
+
var S_IFDIR, S_IFREG, S_IFLNK2, S_IFSOCK, S_IFIFO2, S_IFMT2, PERM_MASK, DEFAULT_DIR_PERM, UMASK2, SEEK_CUR2, SEEK_END2, EARLY_WHOLE_FILE, O_APPEND4, O_ACCMODE, O_TRUNC, O_PATH, stale, opening, O_NOFOLLOW, RESOLVING, O_CREAT, createParentRefresh;
|
|
10229
10289
|
var init_live_vfs_fs = __esm({
|
|
10230
10290
|
"src/realm/live-vfs-fs.ts"() {
|
|
10231
10291
|
"use strict";
|
|
@@ -10265,6 +10325,8 @@ var init_live_vfs_fs = __esm({
|
|
|
10265
10325
|
["readlink", () => false],
|
|
10266
10326
|
["truncate", () => true]
|
|
10267
10327
|
];
|
|
10328
|
+
O_CREAT = 64;
|
|
10329
|
+
createParentRefresh = 0;
|
|
10268
10330
|
}
|
|
10269
10331
|
});
|
|
10270
10332
|
|
|
@@ -10629,7 +10691,7 @@ function kernelUmask(imports, deps) {
|
|
|
10629
10691
|
const { glue } = deps;
|
|
10630
10692
|
wrapImport(imports, "openat", glue, (openat) => (dirfd, path, flags, varargs) => {
|
|
10631
10693
|
const memory = deps.memory();
|
|
10632
|
-
if (flags &
|
|
10694
|
+
if (flags & O_CREAT2 && varargs && memory) new capturedInt32Array(memory.buffer)[varargs >> 2] &= ~umask;
|
|
10633
10695
|
return openat(dirfd, path, flags, varargs);
|
|
10634
10696
|
});
|
|
10635
10697
|
wrapImport(
|
|
@@ -11061,7 +11123,7 @@ function useMounts(Fs, env = {}, live = false) {
|
|
|
11061
11123
|
const seed = (path, text) => {
|
|
11062
11124
|
let stream;
|
|
11063
11125
|
try {
|
|
11064
|
-
stream = open(path, O_WRONLY5 |
|
|
11126
|
+
stream = open(path, O_WRONLY5 | O_CREAT2 | O_EXCL, 420);
|
|
11065
11127
|
} catch {
|
|
11066
11128
|
return;
|
|
11067
11129
|
}
|
|
@@ -11075,8 +11137,8 @@ function useMounts(Fs, env = {}, live = false) {
|
|
|
11075
11137
|
Fs.open = (path, flags, mode) => {
|
|
11076
11138
|
const instead = backing[path];
|
|
11077
11139
|
const text = defaults[path];
|
|
11078
|
-
if (text !== void 0 && (flags & (O_ACCMODE3 |
|
|
11079
|
-
if (!instead || (flags & (O_ACCMODE3 |
|
|
11140
|
+
if (text !== void 0 && (flags & (O_ACCMODE3 | O_CREAT2)) !== 0) seed(path, text);
|
|
11141
|
+
if (!instead || (flags & (O_ACCMODE3 | O_CREAT2)) !== 0) return open(path, flags, mode);
|
|
11080
11142
|
try {
|
|
11081
11143
|
return open(path, flags, mode);
|
|
11082
11144
|
} catch (e) {
|
|
@@ -11193,7 +11255,7 @@ function devCreations(imports, fs, memory, glue) {
|
|
|
11193
11255
|
imports,
|
|
11194
11256
|
"openat",
|
|
11195
11257
|
glue,
|
|
11196
|
-
(own2) => (dirfd, path, flags, varargs) => flags &
|
|
11258
|
+
(own2) => (dirfd, path, flags, varargs) => flags & O_CREAT2 && check(dirfd, path) || own2(dirfd, path, flags, varargs),
|
|
11197
11259
|
true
|
|
11198
11260
|
);
|
|
11199
11261
|
wrapImport(
|
|
@@ -11269,7 +11331,7 @@ function linuxDevices(Fs, owners = true) {
|
|
|
11269
11331
|
}
|
|
11270
11332
|
}
|
|
11271
11333
|
}
|
|
11272
|
-
var O_CLOEXEC, FD_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, tracked, IMPORT_NAMES, EBADF, AT_SYMLINK_NOFOLLOW2, EMSCRIPTEN_EPERM, O_PATH2, LITERALS, UTIME_NOW, UTIME_OMIT, PROT_WRITE, MAP_PRIVATE, MAP_TYPE, O_WRONLY5, MAP_ALIGN, DIR_MODE, LINK_MODE, CHAR_DEVICE, O_TRUNC2, S_IFMT_BITS, S_IFIFO_BITS, REFUSED, OWN_ERRORS, O_ACCMODE3,
|
|
11334
|
+
var O_CLOEXEC, FD_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, tracked, IMPORT_NAMES, EBADF, AT_SYMLINK_NOFOLLOW2, EMSCRIPTEN_EPERM, O_PATH2, LITERALS, UTIME_NOW, UTIME_OMIT, PROT_WRITE, MAP_PRIVATE, MAP_TYPE, O_WRONLY5, MAP_ALIGN, DIR_MODE, LINK_MODE, CHAR_DEVICE, O_TRUNC2, S_IFMT_BITS, S_IFIFO_BITS, REFUSED, OWN_ERRORS, O_ACCMODE3, O_CREAT2, O_EXCL, field, pinnedRoot, rootKind, NAME, AT_FDCWD2, AT_EACCESS2, W_ACCESS, X_ACCESS, AT_SYMLINK_FOLLOW, UTS_FIELD, CHAR_DEVICES, DEVICE_MODES;
|
|
11273
11335
|
var init_process_fds = __esm({
|
|
11274
11336
|
"src/process/process-fds.ts"() {
|
|
11275
11337
|
"use strict";
|
|
@@ -11336,7 +11398,7 @@ var init_process_fds = __esm({
|
|
|
11336
11398
|
REFUSED = new capturedSet([wasiErrno("EACCES"), wasiErrno("EPERM")]);
|
|
11337
11399
|
OWN_ERRORS = 128 | 131072;
|
|
11338
11400
|
O_ACCMODE3 = 3;
|
|
11339
|
-
|
|
11401
|
+
O_CREAT2 = 64;
|
|
11340
11402
|
O_EXCL = 128;
|
|
11341
11403
|
field = (text) => (text || "none").replace(/[\s\\]/g, (c) => `\\${c.charCodeAt(0).toString(8).padStart(3, "0")}`);
|
|
11342
11404
|
rootKind = () => capturedGlobalThis.navigator?.storage ? "opfs" : "memory";
|
|
@@ -11767,6 +11829,7 @@ var init_procfs = __esm({
|
|
|
11767
11829
|
init_captured_globals();
|
|
11768
11830
|
init_cred();
|
|
11769
11831
|
init_proc_info();
|
|
11832
|
+
init_live_vfs_fs();
|
|
11770
11833
|
init_version();
|
|
11771
11834
|
init_process_fds();
|
|
11772
11835
|
HZ = 100;
|
|
@@ -11795,6 +11858,8 @@ var init_procfs = __esm({
|
|
|
11795
11858
|
slicc_opfs_calls: (listing2) => `${listing2.opfsCalls ?? 0}
|
|
11796
11859
|
`,
|
|
11797
11860
|
slicc_opfs_ops: (listing2) => `${listing2.opfsOps ?? 0}
|
|
11861
|
+
`,
|
|
11862
|
+
slicc_create_parent_refresh: (_listing) => `${createParentRefreshCount()}
|
|
11798
11863
|
`,
|
|
11799
11864
|
slicc_meta_transactions: ({ meta }) => `${meta?.reads ?? 0} ${meta?.writes ?? 0}
|
|
11800
11865
|
`,
|
|
@@ -13318,7 +13383,7 @@ function datesOf(real) {
|
|
|
13318
13383
|
dates[key] = new capturedDate(value2);
|
|
13319
13384
|
return dates;
|
|
13320
13385
|
}
|
|
13321
|
-
var POLLIN, POLLOUT, POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, TCSETSF, O_NONBLOCK2, SOCKET_MODE, PTY_PATH, TTY_PATH, PTS_MAJOR, TTY_NAME, SEALED_PATH2, STRERROR, CLIPBOARD_PATH2, EMBEDDER_PATH2, DEVICE_INO,
|
|
13386
|
+
var POLLIN, POLLOUT, POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, TCSETSF, O_NONBLOCK2, SOCKET_MODE, PTY_PATH, TTY_PATH, PTS_MAJOR, TTY_NAME, SEALED_PATH2, STRERROR, CLIPBOARD_PATH2, EMBEDDER_PATH2, DEVICE_INO, O_CREAT3, O_EXCL2, O_NOCTTY, O_TRUNC3, O_DIRECTORY, KILLED_BY_SIGPIPE, ProcessExit, SyscallError, KernelStreams;
|
|
13322
13387
|
var init_kernel_streams = __esm({
|
|
13323
13388
|
"src/process/kernel-streams.ts"() {
|
|
13324
13389
|
"use strict";
|
|
@@ -13351,7 +13416,7 @@ var init_kernel_streams = __esm({
|
|
|
13351
13416
|
CLIPBOARD_PATH2 = "/dev/clipboard";
|
|
13352
13417
|
EMBEDDER_PATH2 = "/dev/embedder";
|
|
13353
13418
|
DEVICE_INO = { 250: 1, 251: 2, 252: 3 };
|
|
13354
|
-
|
|
13419
|
+
O_CREAT3 = 64;
|
|
13355
13420
|
O_EXCL2 = 128;
|
|
13356
13421
|
O_NOCTTY = 256;
|
|
13357
13422
|
O_TRUNC3 = 512;
|
|
@@ -13735,7 +13800,7 @@ var init_kernel_streams = __esm({
|
|
|
13735
13800
|
}
|
|
13736
13801
|
}
|
|
13737
13802
|
refuseExclusiveLink(path, flags) {
|
|
13738
|
-
if ((flags & (
|
|
13803
|
+
if ((flags & (O_CREAT3 | O_EXCL2)) !== (O_CREAT3 | O_EXCL2)) return;
|
|
13739
13804
|
let mode = 0;
|
|
13740
13805
|
try {
|
|
13741
13806
|
mode = this.Fs.stat?.(path, true)?.mode ?? 0;
|
|
@@ -13778,7 +13843,7 @@ var init_kernel_streams = __esm({
|
|
|
13778
13843
|
vessel(open, kfd, at, terminal) {
|
|
13779
13844
|
let stream;
|
|
13780
13845
|
try {
|
|
13781
|
-
stream = open("/dev/null", at.flags & ~(
|
|
13846
|
+
stream = open("/dev/null", at.flags & ~(O_CREAT3 | O_EXCL2 | O_TRUNC3), at.mode);
|
|
13782
13847
|
} catch (e) {
|
|
13783
13848
|
this.sys.close(kfd);
|
|
13784
13849
|
throw e;
|
|
@@ -14096,7 +14161,7 @@ function placeholder(Fs, streams2, entry) {
|
|
|
14096
14161
|
if (entry.kind === "tty") return Fs.open("/dev/tty", O_RDWR4);
|
|
14097
14162
|
if (entry.kind === "stream" || DEVICE_KINDS.has(entry.kind)) return Fs.open("/dev/null", access);
|
|
14098
14163
|
Fs.mkdirTree(PLACEHOLDER_DIR);
|
|
14099
|
-
return Fs.open(`${PLACEHOLDER_DIR}/${entry.fd}`, access |
|
|
14164
|
+
return Fs.open(`${PLACEHOLDER_DIR}/${entry.fd}`, access | O_CREAT4);
|
|
14100
14165
|
}
|
|
14101
14166
|
function asFifo(stream, streams2, identity) {
|
|
14102
14167
|
const inos = streamInos.get(streams2) ?? new capturedMap();
|
|
@@ -14138,7 +14203,7 @@ function restoreForkedStreams(Fs, streams2, table) {
|
|
|
14138
14203
|
} else {
|
|
14139
14204
|
const placed = place(
|
|
14140
14205
|
Fs,
|
|
14141
|
-
Fs.open(entry.path, entry.flags & ~(
|
|
14206
|
+
Fs.open(entry.path, entry.flags & ~(O_CREAT4 | O_EXCL3 | O_TRUNC4)),
|
|
14142
14207
|
entry.fd
|
|
14143
14208
|
);
|
|
14144
14209
|
setCloseOnExec(placed, (entry.flags & O_CLOEXEC) !== 0);
|
|
@@ -14147,7 +14212,7 @@ function restoreForkedStreams(Fs, streams2, table) {
|
|
|
14147
14212
|
}
|
|
14148
14213
|
}
|
|
14149
14214
|
}
|
|
14150
|
-
var O_RDWR4, O_ACCMODE4,
|
|
14215
|
+
var O_RDWR4, O_ACCMODE4, O_CREAT4, O_EXCL3, O_TRUNC4, PLACEHOLDER_DIR, NAMED_DEVICES, DEVICE_KINDS, ACCESS, DEVICES2, FIFO_MODE, nextStreamIno, streamInos;
|
|
14151
14216
|
var init_process_fork = __esm({
|
|
14152
14217
|
"src/process/process-fork.ts"() {
|
|
14153
14218
|
"use strict";
|
|
@@ -14155,7 +14220,7 @@ var init_process_fork = __esm({
|
|
|
14155
14220
|
init_process_fds();
|
|
14156
14221
|
O_RDWR4 = 2;
|
|
14157
14222
|
O_ACCMODE4 = 3;
|
|
14158
|
-
|
|
14223
|
+
O_CREAT4 = 64;
|
|
14159
14224
|
O_EXCL3 = 128;
|
|
14160
14225
|
O_TRUNC4 = 512;
|
|
14161
14226
|
PLACEHOLDER_DIR = "/dev/slicc-fd";
|
|
@@ -16080,7 +16145,7 @@ function signalNumber(signal) {
|
|
|
16080
16145
|
}
|
|
16081
16146
|
return SIG[name2];
|
|
16082
16147
|
}
|
|
16083
|
-
function
|
|
16148
|
+
function resolvePath2(cwd, path) {
|
|
16084
16149
|
const parts = [];
|
|
16085
16150
|
for (const part of (path.startsWith("/") ? path : `${cwd}/${path}`).split("/")) {
|
|
16086
16151
|
if (part === "" || part === ".") continue;
|
|
@@ -16412,7 +16477,7 @@ function createContext(o) {
|
|
|
16412
16477
|
const pending = new capturedSet();
|
|
16413
16478
|
const random2 = o.random ?? cryptoRandom;
|
|
16414
16479
|
let held2;
|
|
16415
|
-
const resolve2 = (path) =>
|
|
16480
|
+
const resolve2 = (path) => resolvePath2(cwdFor(o.cwd, held2, path), path);
|
|
16416
16481
|
const tryDev = (abs) => resolveDevAsync(kernel, abs);
|
|
16417
16482
|
const clean = cleanOf(o.changes);
|
|
16418
16483
|
let exiting;
|