@ai-ecoverse/slicc-kernel 1.147.7 → 1.147.8
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 +3 -2
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +51 -30
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +3 -2
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +51 -30
- package/dist/process-worker.js.map +2 -2
- package/dist/types/process/js/js-context.d.ts +1 -0
- package/dist/types/process/js/js-io.d.ts +5 -0
- package/dist/types/process/js/js-sync.d.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -368,7 +368,7 @@ The module's default export (or its `main` export) is called with a context and
|
|
|
368
368
|
- `argv` (with `argv[0]`), `env`, `pid` (the pid `ps` shows, also after an `exec`), `ppid()` (asked each time, so an orphan sees 1) and `cwd`, and `resolve(path)` to make a path absolute against `cwd`;
|
|
369
369
|
- `stdin`, `stdout` and `stderr` as web streams, and `read(fd, max?)` (empty at end of file), `write(fd, bytes | string, { nonblock }?)` and `close(fd)` on any descriptor it inherited. A write waits until the pipe has room, so a slow reader slows the program down, and answers the byte count. With `{ nonblock: true }` (also `sync.write`), it doesn't wait: it takes what fits now (at most 1 MiB) and answers that count, possibly fewer bytes than given, or fails with `EAGAIN` when nothing fits. The descriptor's own flags don't change. A regular file takes it all, as on Linux. A pipe with no reader is still `EPIPE` with `SIGPIPE`, and a socket is `EPIPE` alone ([#1124](https://github.com/ai-ecoverse/slicc-kernel/issues/1124));
|
|
370
370
|
- `fdStatus(fd)` (`{ type, tty, seekable }`, `type` being `file`, `pipe`, `tty`, `socket`, `device` or `directory`) and `isatty(fd)`, to tell `< file` from a pipe;
|
|
371
|
-
- `open(path, { read, write, append, create, exclusive, truncate, nonblock, signal })`, which returns a file with `read(position, length)`, `write(position, bytes)`, `size()`, `truncate(size)`, `sync()` and `close()`. Reads and writes go through the kernel's paged files at those positions, so a large file is never read whole; **A FIFO** ([#935](https://github.com/ai-ecoverse/slicc-kernel/issues/935)) opens through the kernel's FIFO open, as fifo(7) says. A read-open waits for a writer and a write-open for a reader, unless the open is `read` and `write` both. `nonblock: true` gives a read-open at once and a write-open with no reader `ENXIO`, and `signal` aborts a waiting open with its reason. Its file reads and writes the pipe: `read(0, length)` and `write(0, bytes)`, any other position is `ESPIPE`, `size()` is `0`, and `truncate` is `EINVAL`. A socket node is `ENXIO`.
|
|
371
|
+
- `open(path, { read, write, append, create, exclusive, truncate, nonblock, signal })`, which returns a file with `read(position, length)`, `readInto(position, into, offset?, length?)` (fills `into` from `offset`, `length` defaulting to the rest of it, and returns the bytes read; a range that doesn't fit is `EINVAL`), `write(position, bytes)`, `size()`, `truncate(size)`, `sync()` and `close()`. Reads and writes go through the kernel's paged files at those positions, so a large file is never read whole; one read asks the kernel for up to 16 MiB at a time ([#1431](https://github.com/ai-ecoverse/slicc-kernel/issues/1431)), so a big `read` or `readInto` costs one kernel call per 16 MiB; **A FIFO** ([#935](https://github.com/ai-ecoverse/slicc-kernel/issues/935)) opens through the kernel's FIFO open, as fifo(7) says. A read-open waits for a writer and a write-open for a reader, unless the open is `read` and `write` both. `nonblock: true` gives a read-open at once and a write-open with no reader `ENXIO`, and `signal` aborts a waiting open with its reason. Its file reads and writes the pipe: `read(0, length)` and `write(0, bytes)`, any other position is `ESPIPE`, `size()` is `0`, and `truncate` is `EINVAL`. A socket node is `ENXIO`.
|
|
372
372
|
- `fs`: `stat`, `lstat`, `exists`, `readdir`, `mkdir` (with parents, or, with `{ recursive: false }`, as Node's `fs.mkdir` without `recursive`: `EEXIST` for an existing entry and `ENOENT` for a missing parent, atomically among the processes of one kernel, so it can serve as a lock there, but not between two kernels on one origin, such as two tabs ([#519](https://github.com/ai-ecoverse/slicc-kernel/issues/519)); `sync.fs.mkdir` takes the same option), `rm` (recursive), `unlink`, `rename`, `symlink`, `readlink`, `statfs`, `chmod(path, mode)`, and `readFile`/`writeFile` for small files. `chmod` takes the permission bits (`0` to `0o7777`, `EINVAL` otherwise) and follows a symlink; as `chmod(2)`, only the file's owner or root may (`EPERM`), so a program can make a script it wrote runnable by path. `sync.fs.chmod` is the same, synchronously. `statfs(path)` answers `{ type, bsize, blocks, bfree, bavail, files, ffree, quota, usage }`: the fields of Node's `StatFs`, plus `quota` and `usage` in bytes (what jsh 0.17 reads). The values come from the same source as an Emscripten program's `statfs`/`df`: the driver of the mount the path is on, or, on the root file system, the origin's storage estimate (`navigator.storage.estimate()`). `bsize` is 4096, `bfree` and `bavail` are what's left of the quota, and `type`, `files` and `ffree` are 0, since the kernel doesn't know them. Where there's no estimate (the Node entry's root), every count is 0. A missing path is `ENOENT`. `sync.fs` has it too. `rm` removes a whole tree in one kernel call (on the OPFS root, one recursive removal and one metadata delete: 50,000 files take about 3 s in Chrome, where `rm -r` takes about 25 s) with the result of a file-by-file removal: symlinks inside the tree are removed, never followed; a tree holding a protected path is refused with `EROFS` and nothing is removed; a mount inside the tree is emptied and its mount point answers `EBUSY`, while the rest is removed; under `users`, what the user may remove is removed and the call then fails with the first `EACCES`/`EPERM`; files a process holds open stay readable to it;
|
|
373
373
|
- **`fs.watch(path, options?, onEvent)`** resolves with `{ close() }` ([#1031](https://github.com/ai-ecoverse/slicc-kernel/issues/1031)). `sync.fs.watch` returns the watcher directly and is in place when it returns, so it sees every change made after the call. This is the shape for Node's synchronous `fs.watch`.
|
|
374
374
|
- **What it reports:** a file reports its own changes. A directory reports its direct entries, or with `{ recursive: true }`, everything below it.
|
package/dist/kernel-worker.js
CHANGED
|
@@ -7805,7 +7805,7 @@ function satisfies(version, range2) {
|
|
|
7805
7805
|
}
|
|
7806
7806
|
|
|
7807
7807
|
// src/version.ts
|
|
7808
|
-
var KERNEL_VERSION = true ? "1.147.
|
|
7808
|
+
var KERNEL_VERSION = true ? "1.147.8" : "0.0.0-dev";
|
|
7809
7809
|
var OS_RELEASE = "6.0.0-slicc";
|
|
7810
7810
|
function procVersion() {
|
|
7811
7811
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -23322,6 +23322,7 @@ function isWasmSyscall(req) {
|
|
|
23322
23322
|
return typeof op === "string" && SYSCALL_OPS.has(op);
|
|
23323
23323
|
}
|
|
23324
23324
|
var MAX_READ = 1024 * 1024;
|
|
23325
|
+
var MAX_PREAD = 16 * 1024 * 1024;
|
|
23325
23326
|
var O_NONBLOCK = 2048;
|
|
23326
23327
|
var WRITE_ACCESS = 3;
|
|
23327
23328
|
var KEYBOARD = /* @__PURE__ */ new Set([SIG.INT, SIG.QUIT, SIG.TSTP]);
|
|
@@ -24268,7 +24269,7 @@ var WasmProcess = class {
|
|
|
24268
24269
|
return {
|
|
24269
24270
|
ok: true,
|
|
24270
24271
|
kind: "bytes",
|
|
24271
|
-
bytes: await file.pread(Math.min(req.max,
|
|
24272
|
+
bytes: await file.pread(Math.min(req.max, MAX_PREAD), req.offset)
|
|
24272
24273
|
};
|
|
24273
24274
|
case "fd-pwrite":
|
|
24274
24275
|
return { ok: true, kind: "json", json: await file.pwrite(req.body, req.offset) };
|