@ai-ecoverse/slicc-bios 1.47.2 → 1.48.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.
Files changed (2) hide show
  1. package/README.md +3 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -9,6 +9,8 @@ The page shows six boot steps as they run:
9
9
  3. **Install packages from npm into OPFS** – the installer reads [`src/packages/package-lock.json`](src/packages/package-lock.json), the lockfile the BIOS ships with. It skips packages that name an `os` or `cpu` (native binaries such as esbuild's, which can't run in a browser). For every other locked package it downloads the tarball from `registry.npmjs.org` and checks its `integrity`, then unpacks it with the built-in `DecompressionStream` and [`modern-tar`](https://github.com/ayuhito/modern-tar) into OPFS at its lockfile path (`node_modules/…`), dropping `.` segments from entry names and skipping any entry with `..`. A package that is already there is rewritten in place, never emptied first: every file is overwritten whole (an OPFS write commits on close), the entry points come last: a command's wasm (and its variants), then its glue or script with `bin`, `main` and `exports` targets, then `package.json`, and only then do the files the new version no longer has go, so a running kernel or another tab never finds the package missing. While it unpacks, it hashes every file (SHA-256) and records the hashes in IndexedDB (see [Integrity](#integrity)). It also keeps each file's mode from the tarball, owned by root: once a package's files are in, it hands their paths and modes to the kernel's `writeMetadata` (`@ai-ecoverse/slicc-kernel/meta`, read from the installed kernel), in one batch per run, so an executable outside `bin/`, such as pnpm's `shims/i`, stays executable when the kernel checks modes. The seed's files are recorded as root's `0644`. A kernel without `/meta` skips this. A package installed before the kernel had `/meta` gets its modes once, on the first run with it: the installer fetches its tarball again, checks its integrity, reads the modes from the headers without unpacking, and marks the receipt (`modes: true`). A package installed or replaced later is marked when it's stamped. It also records a receipt in `var/lib/bios/`. A package whose recorded integrity matches the lockfile's and whose files are still there isn't downloaded again, so pinning a new version replaces just that package. Replacing a package keeps its nested `node_modules`, and packages the lockfile no longer lists are deleted along with their receipts and hashes. A package without recorded hashes is downloaded again, even with a receipt, so the first boot after integrity checks arrived downloads the base set once. Last, the installer copies the deployment's `package.json` and `pnpm-lock.yaml` to the OPFS root for pnpm, and the lockfile once more to `var/lib/slicc/pnpm-lock.yaml`, which records what is installed (see [Updates](#updates)).
10
10
  4. **Add UI page to OPFS** – the installer copies `src/seed/` to `os/` in OPFS and records each file's hash. This is a stand-in until the UI ships as a downloadable asset.
11
11
  5. **Intercept same-origin requests** – `sw.js`, a module service worker, answers in-scope requests from OPFS and passes everything else to the network (see [What the service worker serves](#what-the-service-worker-serves)). The code it serves from OPFS carries `Cross-Origin-Opener-Policy: same-origin`, `Cross-Origin-Embedder-Policy: require-corp` and `Cross-Origin-Resource-Policy: same-origin`, so the UI page and the workers it starts are cross-origin isolated. Scripts it serves get their bare imports resolved (see [Modules](#modules)).
12
+
13
+ Every boot registers `sw.js` again and asks Chrome for an update. Chrome compares `sw.js` and then the modules it imports, in URL order, and stops at the first one that changed. When only a module changed, it copies the unchanged modules it compared before that one into the new worker, and that copy fails in Chrome 156 with *ServiceWorker cannot be started* (#1022). So when the update fails, the BIOS registers the service worker under its other URL, `sw.js?afresh` or `sw.js`, which Chrome installs whole from the network without comparing; later boots update whichever of the two is registered. When that install fails too, offline for instance, the step fails with the update's error and the installed worker keeps serving.
12
14
  6. **Serve UI from OPFS** – navigate to `os/` (keeping the URL fragment) with a cross-document view transition. That page imports [`@ai-ecoverse/slicc-kernel`](https://github.com/ai-ecoverse/slicc-kernel) and [`@ai-ecoverse/slicc-spectrum`](https://github.com/ai-ecoverse/slicc-spectrum) by name from `node_modules/` in OPFS, starts the kernel on the OPFS root and boots SLICC's UI, `<slicc-app>`, on spectrum's kernel model. The agent comes later, from its own pnpm project (see [Agent](#agent)). Commands come from the installed packages: `bash`, coreutils, `grep`, `sed`, findutils, `gawk`, `diff` (with `cmp`, `sdiff` and `diff3`), `patch`, `rg` (ripgrep), `jq`, `less`, `tree`, `tar` with `gzip`, `xz` and `bzip2` (and their `gunzip`, `zcat`, `unxz`, `xzcat`, `lzma`, `bunzip2` and `bzcat` names), `curl`, `mount`, `umount`, `clear`, `tput`, `tset`, `reset`, `pnpm` with its `npm` and `npx` shims, and `playwright-cli` and `curlwright` from slicc-cdp. The shell starts in `/home` as **root** (slicc-kernel ≥ 1.44.0 has users: `/etc/passwd` and `/etc/group` list root, nobody, sudo, users and nogroup), so the prompt ends in `#`, `whoami` and `id` say root, `ls -l` and `ps` show user names, and root's `HOME` is `/root` (mode 0700) with `PNPM_HOME=/usr/local/share/pnpm`. bash, coreutils, procps and git are the homescoop H1 rebuilds that know about users; older builds claimed uid 1000. `tar` forks the compressors for `-z`, `-J` and `-j` through `/bin/sh`. Hard links in archives aren't recreated, and there's no `--zstd`. xz is single-threaded: `-T` is accepted but has no effect. xz's `xzgrep`, `xzdiff` and `xzless` wrapper scripts are installed too, running seven's own grep, diff and less; gzip's `zgrep` and bzip2's `bzgrep`-style wrappers aren't. Whatever the shell writes stays in OPFS across reloads. The kernel terminates HTTPS with `wasm-tls-engine`, so `curl https://…` works over whichever transport is picked (see [Network](#network)). `wasm-git` is left out for its size (53 MB); it can come later through pnpm.
13
15
 
14
16
  ## What the service worker serves
@@ -345,7 +347,7 @@ Programs ask seven's page for what only a page can do through the kernel's `/dev
345
347
  - **`clipboard.write`** (`{"kind":"clipboard.write","type":"image/png"}`, the bytes as the body, an empty reply; `screencapture -c`): `src/seed/clipboard.js` writes one `ClipboardItem` of `image/png`, `text/plain` or `text/html`, with `/dev/clipboard`'s focus rule and refusal text. Other types are `ENOTSUP`. The body is read up to 16 MB; beyond that seven cancels the rest and fails with `EIO`, `seven copies at most 16 MB to the clipboard`.
346
348
  - **Audio** (`afplay`, `chime`, `say`, `hear`, `@ai-ecoverse/slicc-audio/page`; kinds `audio.play`, `audio.say`, `audio.voices`, `audio.record`, `audio.transcribe`):
347
349
  - **Sound and speech:** `audio.play` ("Play a sound?") and `audio.say` ("Speak aloud?") get the same gesture check as `open.url`.
348
- - **The microphone:** `audio.record`, and every `audio.transcribe` except a probe or a `whisper` one that sends its own audio, ask "Use the microphone?" on every request, unless the request comes typed in an active tab. The agent is always asked. The browser's microphone permission lasts per origin after the first grant, so it isn't the gate; seven's prompt is. Cancel leaves the microphone unopened.
350
+ - **The microphone:** `audio.record`, and every `audio.transcribe` except a probe or a `whisper` one that sends its own audio, ask "Use the microphone?" on every request, unless the request comes typed in an active tab. When the request carries a positive `seconds`, the prompt says how long ("…record from your microphone for up to 5 seconds"). The agent is always asked. The browser's microphone permission lasts per origin after the first grant, so it isn't the gate; seven's prompt is. Cancel leaves the microphone unopened.
349
351
  - **No prompt:** `audio.voices`; `audio.say` status and warm-up; `audio.transcribe` status, warm-up and supported-language probes; and a `whisper` transcribe of bytes the program sends. Listing microphones (`audio.record` with `devices`) asks like any recording. For `whisper`, seven reads the start of the request's body to see whether it carries audio. Web Speech (`webspeech`) always listens to the microphone and ignores any bytes, so it's always asked, and so is an unknown or missing engine.
350
352
  - **Stopping:** an abort (a signal, or the program closing the request) stops a recording at once.
351
353
  - **ortllama:** slicc-audio's optional `@ai-ecoverse/slicc-ortllama` isn't in the base set, because the BIOS installer skips lock entries marked `optional` and the in-place base update runs `pnpm install --no-optional`. So `afplay`, `chime` and the Web Speech engines work. The kokoro and whisper engines fail with `sw: nothing listening on kernel port 11435` until an ortllama server runs in the kernel.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.47.2",
3
+ "version": "1.48.1",
4
4
  "description": "Slim loader that boots SLICC into OPFS and serves the UI from there",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",