@ai-ecoverse/slicc-bios 1.55.27 → 1.56.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 +13 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -5,7 +5,7 @@ A slim loader for [SLICC](https://github.com/ai-ecoverse/slicc), from the boot-p
5
5
  The page shows six boot steps as they run:
6
6
 
7
7
  1. **Acquire OPFS** – open the origin private file system and ask for persistent storage.
8
- 2. **Create installer worker** – start `installer.js`, a shared worker that does all of the BIOS's OPFS writes and is shared by every tab.
8
+ 2. **Create installer worker** – start `installer.js`, a shared worker that does all of the BIOS's OPFS writes and is shared by every tab. On a shared origin it first disarms SLICC 6's service worker, which would otherwise answer every npm download (see [SLICC 6's proxy worker](#slicc-6s-proxy-worker)).
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 pins only what UI boot and the agent install need (Lars, 2026-10-21): slicc-kernel, slicc-spectrum, slicc-browsers (the guard's catalog), slicc-capture and slicc-audio (the page's capture and audio), wasi-pnpm, bash, coreutils, findutils, the TLS engine (the kernel's HTTPS) and fnox (the agent's secrets). Every other tool comes after boot, at npm's `latest` (see [Seven's tools](#sevens-tools)). 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. Each package's overwrite, sweep and hashes run inside the installed kernel's `replacing()` (`@ai-ecoverse/slicc-kernel/meta`, kernel 1.168.0 and later, loaded once per run like `writeMetadata` below). It holds the package directory's Web Lock `slicc-kernel-replacing:v1:slicc-kernel:/<path>` until the package is written and the running kernels have been told to drop what they cached of it, and every kernel loads a program's files under that lock. So an exec that starts meanwhile waits, then loads the new version whole, never the new wasm with the old glue ([#663](https://github.com/ai-ecoverse/slicc-bios/issues/663)). A kernel without `replacing()` gets its packages written as before. 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)).
@@ -83,6 +83,17 @@ On a shared origin, the BIOS moves SLICC 6 into seven in this browser once, afte
83
83
  - **Opening seven:** after an upgrade on exactly `www.sliccy.ai`, each boot renews `slicc-home=www` (`Domain=sliccy.ai`, `Path=/`, `Secure`, `SameSite=Lax`, 400 days). Only a top-level BIOS on exactly `seven.sliccy.ai` follows it to `https://www.sliccy.ai/7/`, keeping the fragment, and only if its own OPFS `os/` directory is absent. Other cookie values and hosts are ignored. `?stay` clears the cookie, removes the flag and boots here.
84
84
  - **The import:** once the agent runs on `/os/`, `os/six.js` hands `slicc-os.six-import` to it with `control.importProfile({ inPlace })`. The agent moves the files out of `/slicc-fs`, and deletes the directory on success; the key goes then. An import that fails or throws keeps the key and shows a notice, and the next start tries again. Closing the notice hides it until the next start; its **Stop trying** drops the key, so seven stops trying and leaves SLICC 6's files where they are (in `/slicc-fs` and the export directory). A key whose directory has no readable `manifest.json` stays too, with the same notice, and nothing moves; only leftover directories that no key names are ignored. Tabs take turns under the Web Lock `slicc-os.six-import` and read the key again once they hold it.
85
85
 
86
+ #### SLICC 6's proxy worker
87
+
88
+ A SLICC 6 tab registers `/llm-proxy-sw.js` at scope `/`, over seven's `sw.js` when that's there. Six's launcher opens such a tab (`/?tray=…&bridge=…`) in the profile it shares with seven. Every page and worker the browser starts on the origin then runs under six's worker, which sends every cross-origin fetch to six's fetch proxy. www has no fetch proxy, so every npm download comes back as `404 {"error":"Fetch proxy not available in worker mode"}` under npm's URL. A client keeps the worker it started with, so registering `sw.js` later doesn't free the BIOS page or an installer that's already running. The **Create installer worker** step deals with six's worker before it starts the installer (`sw/disarm.js`):
89
+
90
+ - **Found:** the page's controller or the active worker of the registration at `/` is the origin's `/llm-proxy-sw.js`. Otherwise the step does nothing more, and its output stays `connection #N`.
91
+ - **Disarmed:** the BIOS asks Chrome for six's newest worker (`registration.update()`) and waits up to 10 s for it to activate. It then posts `{ type: 'slicc-six-disarm' }` with a `MessagePort` to every six worker it found and waits 3 s for `{ type: 'slicc-six-disarmed' }`. A six worker that answers stops answering fetches for every client it controls, an installer a six tab started included (ai-ecoverse/slicc, `ui/llm-proxy-sw-disarm.ts`). It also stays disarmed when it starts after seven has set `__Host-slicc-six-retired`. The step reads `connection #N, SLICC 6's service worker disarmed`.
92
+ - **Unregistered:** a six worker from before the disarm message doesn't answer. The BIOS unregisters six's registration, unless seven's worker is installing or waiting in it, so an installer that starts now starts without a worker. The step reads `connection #N, SLICC 6's service worker unregistered`, or `… still answers` when even that failed.
93
+ - **The installer's check:** an installer that's already running under an old six worker can't be freed. A response a service worker made itself reads as `basic` even for another origin, where the network's reads as `cors`, so the installer refuses a cross-origin download that reads as `basic` or `default`. The packages step then fails with `404 <url> came from a service worker, not the network: close every tab of <origin> and open seven again`, rather than npm's URL and a 404.
94
+ - **The diagnostics:** the first log line reads `boot (repeat visit)` only when seven's own `sw.js` controls the page. Under another worker it reads `boot (under /llm-proxy-sw.js)`.
95
+ - **Tests:** `six-proxy.test.mjs`, with an old and a new six worker from `fake-six.mjs`.
96
+
86
97
  ### Integrity
87
98
 
88
99
  A kernel process can still write to `/os/` and `/node_modules/` (any process while the kernel's users are off, root after that). So the service worker checks what it serves from there against the hashes the BIOS recorded, never against bytes on disk:
@@ -418,7 +429,7 @@ Such a browser also leaves seven's own pages out of its listing and refuses navi
418
429
 
419
430
  An older extension, or one that cannot report a supported release version, refuses browser automation with `slicc: refused: Update slicc-extension to use browser automation in seven. Reload this tab after updating.` Fetch and sign-in remain available.
420
431
 
421
- **Seven's own pages and the vault are out of reach.** Every connection, whether through the extension, a DevTools port or a linked browser, goes through a guard (`guardProtected` in `os/guard.js`), so no program in the kernel can drive, read or close a protected tab. What is protected comes from [slicc-browsers](https://github.com/ai-ecoverse/slicc-browsers#protected-origins)' `protectedOrigins` (in the base set): every `sliccy.ai` host, the vault (`vault.sliccy.ai`), `blob:`, `filesystem:` and `view-source:` URLs by the URL inside them, and `devtools:`, plus seven's own origin. A blank popup or frame (`about:blank`, `about:srcdoc`) is protected when its opener is protected or unknown, or when it was protected before. Seven's own pages can show files from OPFS that the user or the agent wrote, and the vault holds the user's secrets.
432
+ **Seven's own pages and the vault are out of reach.** Every connection, whether through the extension, a DevTools port or a linked browser, goes through a guard (`guardProtected` in `os/guard.js`), so no program in the kernel can drive, read or close a protected tab. A client `Browser.getVersion` result the guard forwards includes `slicc: { route: "extension" | "link" | "devtools" }` as a hint that a guard sits in the path (absence means no information); an inbound `slicc` key on that result is replaced, Chrome's other fields stay, and an error or non-object reply is left alone. What is protected comes from [slicc-browsers](https://github.com/ai-ecoverse/slicc-browsers#protected-origins)' `protectedOrigins` (in the base set): every `sliccy.ai` host, the vault (`vault.sliccy.ai`), `blob:`, `filesystem:` and `view-source:` URLs by the URL inside them, and `devtools:`, plus seven's own origin. A blank popup or frame (`about:blank`, `about:srcdoc`) is protected when its opener is protected or unknown, or when it was protected before. Seven's own pages can show files from OPFS that the user or the agent wrote, and the vault holds the user's secrets.
422
433
 
423
434
  A browser extension's frame inside an ordinary page, such as a password manager's autofill list, does not lock the tab once the linked CLI marks the owner iframe with `sliccExtensionFrame` (version 1). Without that marker the guard behaves as on main. The frame itself stays unattachable and unread, and its URL never appears in discovery, page reads, snapshots, accessibility trees or evaluate results as plain text: redaction is text-based, so an encoded form such as `btoa(iframe.src)` can still pass. The tab's own page stays readable and snapshottable. Screenshots and input are admitted only while every such frame is hidden (no layout box or `visibility: hidden`) and none holds focus through nested documents or shadow roots; when the marker omits `hidden`/`focused`, the guard's own live check must say the same. A screenshot taken while one became shown is thrown away. Opacity and off-screen position do not count as hidden. Whole-page captures and starting a screencast are refused while any extension frame is present; a running screencast is stopped or its later frames are dropped until the frame is gone. A frame from seven's own extension, and any other protected frame, still locks the whole tab. Real-Chrome C9.frame rows stay capability-gated off until a follow-up pins a slicc-cli release that emits the marker (expected after 1.61.12). A race between the visibility or focus check and the CDP reply is an accepted limit.
424
435
  - **Hidden targets:** `Target.getTargets` and the target events leave protected targets out.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.55.27",
3
+ "version": "1.56.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",
@@ -49,7 +49,7 @@
49
49
  "format": "biome check --write ."
50
50
  },
51
51
  "devDependencies": {
52
- "@ai-ecoverse/slicc": "1.61.14",
52
+ "@ai-ecoverse/slicc": "1.62.0",
53
53
  "@ai-ecoverse/slicc-browsers": "1.20.3",
54
54
  "@ai-ecoverse/slicc-cdp": "1.46.2",
55
55
  "@ai-ecoverse/slicc-kernel": "1.174.0",