@ai-ecoverse/slicc-kernel 1.191.0 → 1.191.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 +1 -1
- package/dist/async-process.js +1 -1
- package/dist/async-process.js.map +2 -2
- package/dist/cloudflare-sources.js +1 -1
- package/dist/cloudflare.js +1 -1
- package/dist/kernel-worker.js +1 -1
- package/dist/node-process-worker.cjs +5 -3
- package/dist/node-process-worker.cjs.map +2 -2
- package/dist/node-process-worker.js +5 -3
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +1 -1
- package/dist/process-worker.js +5 -3
- package/dist/process-worker.js.map +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -579,7 +579,7 @@ The module's default export (or its `main` export) is called with a context and
|
|
|
579
579
|
- `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));
|
|
580
580
|
- `fdStatus(fd)` (`{ type, tty, seekable }`, `type` being `file`, `pipe`, `tty`, `socket`, `device` or `directory`) and `isatty(fd)`, to tell `< file` from a pipe;
|
|
581
581
|
- `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)`, `readInto(0, into, offset?, length?)` and `write(0, bytes)`, any other position is `ESPIPE`, `size()` is `0`, and `truncate` is `EINVAL`. A socket node is `ENXIO`.
|
|
582
|
-
- `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. `chown(path, uid, gid)` takes ids from `0` to `0xfffffffe`, or `-1` to keep one (`EINVAL` otherwise), and `utimes(path, atimeMs, mtimeMs)` milliseconds since the epoch, as `stat` gives them (`EINVAL` for a value that isn't a finite number); both follow a symlink and the rules of `chown(2)` and `utimensat(2)` (see [File owners](#file-owners)), and an older kernel's `ctx.fs` has neither, so a runtime checks `typeof ctx.fs.chown === 'function'`. `sync.fs.chmod`, `sync.fs.chown` and `sync.fs.utimes` are 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;
|
|
582
|
+
- `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. `chown(path, uid, gid)` takes ids from `0` to `0xfffffffe`, or `-1` to keep one (`EINVAL` otherwise), and `utimes(path, atimeMs, mtimeMs)` milliseconds since the epoch, as `stat` gives them (`EINVAL` for a value that isn't a finite number, or is outside a JS `Date`'s range of ±8.64e15 ms); both follow a symlink and the rules of `chown(2)` and `utimensat(2)` (see [File owners](#file-owners)), and an older kernel's `ctx.fs` has neither, so a runtime checks `typeof ctx.fs.chown === 'function'`. `sync.fs.chmod`, `sync.fs.chown` and `sync.fs.utimes` are 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;
|
|
583
583
|
- **`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`.
|
|
584
584
|
- **What it reports:** a file reports its own changes. A directory reports its direct entries, or with `{ recursive: true }`, everything below it.
|
|
585
585
|
- **Events:** each one is `{ type, filename, seq }`, in the order the operations happened.
|
package/dist/async-process.js
CHANGED
|
@@ -1362,7 +1362,7 @@ function createParentRefreshCount() {
|
|
|
1362
1362
|
}
|
|
1363
1363
|
|
|
1364
1364
|
// src/version.ts
|
|
1365
|
-
var KERNEL_VERSION = true ? "1.191.
|
|
1365
|
+
var KERNEL_VERSION = true ? "1.191.2" : "0.0.0-dev";
|
|
1366
1366
|
var OS_RELEASE = "6.0.0-slicc";
|
|
1367
1367
|
function procVersion() {
|
|
1368
1368
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|