@ai-ecoverse/slicc-bios 2.0.1 → 2.1.0

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 +9 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@ 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
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)). The installer has 30 s to answer. One that an earlier client started (connection #2 or later) can be stuck, so it also says how it reaches the network: it fetches modern-tar from jsDelivr (10 s at most) and checks who answered, and it lists the calls it is running, with how long each has been quiet. The BIOS replaces it when a service worker answered (`a service worker answered its downloads`), nothing answered (`its downloads got no answer in 10 s`, unless a packages run is going and the installer got data from npm in the last 30 s, so a probe slowed by another tab's downloads stops nothing that still makes progress), or a packages run has had no progress and no download data for 2 minutes (`its packages run made no progress for 121 s at node_modules/pako`, naming the packages it was writing). Replacing means the `reset` call: the old installer ends every other call it runs with `the installer stopped: seven's BIOS replaced it: <why>`, which releases their Web Locks, and closes itself; the BIOS then connects again until a new installer answers (10 tries). The step reads `connection #3: <why>, starting a new installer`, then `connection #1, replaced the installer (<why>)`. An installer that can't reach npm at all (offline) isn't replaced.
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), slicc-devices (the page's serial ports, with esptool-js and the pako and atob-lite it depends on, for `esptool`), 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)).
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), slicc-devices (the page's serial ports and USB devices, with esptool-js and the pako and atob-lite it depends on, for `esptool`), 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
 
11
11
  The step says what it waits for. The run takes the Web Lock `slicc-packages`; when another run holds it, the step reads `waiting 30 s for another install of the packages (held by another seven tab)`, or `(held by this installer's other run, 612 s in, at node_modules/pako)`, updated every 30 s, with how many more wait. Then it reads `reading the lockfile`, `downloading <path>` as each package starts, and `3/15 <path>` as each one is in. Its network waits are bounded: a download gets two 30 s windows without data, modern-tar's and the integrity ledger's imports 60 s each, and the `tools.json` fetch 30 s. Whatever else stalls a run (an OPFS write, a kernel's `replacing()` lock) is what the 2-minute check at **Create installer worker** catches. Every boot step that reports nothing for 15 s adds `, nothing new for 15 s` to its last line, once every 15 s, so a stalled boot names the step and the line it stalled at.
12
12
  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.
@@ -18,7 +18,7 @@ The page shows six boot steps as they run:
18
18
  ## Seven's tools
19
19
 
20
20
  The base set pins only what UI boot and the agent install need, as the code shows:
21
- - **slicc-kernel, slicc-spectrum, slicc-browsers, slicc-capture, slicc-audio and slicc-devices:** the page imports them (`os.js` imports `@ai-ecoverse/slicc-capture/page`, `@ai-ecoverse/slicc-audio/page` and `@ai-ecoverse/slicc-devices/page`). slicc-devices' `serial` and `esptool` commands are in `/usr/bin` because the kernel reads `slicc.commands` from the base set. slicc-audio's optional slicc-ortllama isn't installed. The guard reads slicc-browsers' catalog.
21
+ - **slicc-kernel, slicc-spectrum, slicc-browsers, slicc-capture, slicc-audio and slicc-devices:** the page imports them (`os.js` imports `@ai-ecoverse/slicc-capture/page`, `@ai-ecoverse/slicc-audio/page` and `@ai-ecoverse/slicc-devices/page`). slicc-devices' `serial`, `esptool` and `usb` commands are in `/usr/bin` because the kernel reads `slicc.commands` from the base set. slicc-audio's optional slicc-ortllama isn't installed. The guard reads slicc-browsers' catalog.
22
22
  - **wasi-pnpm:** it installs `/opt/agent`.
23
23
  - **bash:** the terminal runs `bash -i`, `sh` is bash, and bios's boot scripts are bash.
24
24
  - **coreutils:** bios's boot scripts need it (`/mnt`, the legacy homes' lock, the fnox config, known hosts), and so does the sudo check, which fails closed without it.
@@ -168,10 +168,10 @@ The kernel runs with users on (slicc-kernel ≥ 1.81.0): files have owners and m
168
168
 
169
169
  - **The mode:** production seven (`seven.sliccy.ai` and `www.sliccy.ai`) always runs `'enforce'` (`PRODUCTION_USERS` in `os/users.js`). A URL or `localStorage` asking for another mode is ignored there, with a console warning, so nobody can switch seven off from a link. On previews, localhost and in tests the default is `'enforce'` too, and `#users=off`, `#users=report` or `#users=enforce` picks another, remembered in `localStorage['slicc-os.users']`. `'report'` checks every file call and logs what `'enforce'` would refuse, and refuses nothing. `sudo` asks only under `'enforce'`. bios passes the mode to every kernel it creates, `'off'` included, since kernels from K4b on default to `'enforce'`. `<html data-users>` says which mode is on.
170
170
  - **Who is who:** the human's panel terminals are root (`/root`, mode 0700). With users on, bios adds the first cone, `cone`, at every boot: in `sudo`, home `0710`, umask `077`. The agent adds further cones and scoops through its `KernelSource`. The file tree skips `~/.local/share/pnpm` and `~/.cache` of every home in `/etc/passwd`.
171
- - **Device groups** (slicc-kernel ≥ 1.176.0): at every boot, after the first cone, bios calls `kernel.groups.add('dialout', { gid: 20 })`, since an `/etc/group` from an older kernel has none, and adds every `cone`, `cone-<n>` and `scoop-<folder>` user to it (`deviceGroups()` in `os/users.js`). Every user the agent adds through its `KernelSource` gets `dialout` too, scoops included, so every agent can read the serial ports and none can write to one without `sudo` (see [Serial ports](#requests-from-programs-devembedder)). The same pass also re-adds each personal cone and scoop to group `cone` (for Files-panel fsa group write; see [Folder mounts](#folder-mounts)), so an agent's `removeMember('cone', …)` lasts only until the next boot. The agent's `groups.addMember` and `removeMember` still take only a cone's group.
171
+ - **Device groups** (slicc-kernel ≥ 1.176.0): at every boot, after the first cone, bios calls `kernel.groups.add('dialout', { gid: 20 })` and `kernel.groups.add('plugdev', { gid: 46 })`, since an `/etc/group` from an older kernel or an older seven has neither, and adds every `cone`, `cone-<n>` and `scoop-<folder>` user to both (`deviceGroups()` in `os/users.js`). Every user the agent adds through its `KernelSource` gets `dialout` and `plugdev` too, scoops included, so every agent can read the serial ports and USB devices and none can write to one without `sudo` (see [Serial ports and USB devices](#requests-from-programs-devembedder)). The same pass also re-adds each personal cone and scoop to group `cone` (for Files-panel fsa group write; see [Folder mounts](#folder-mounts)), so an agent's `removeMember('cone', …)` lasts only until the next boot. The agent's `groups.addMember` and `removeMember` still take only a cone's group.
172
172
  - **Folders** bios mounts (picked in the Files panel, remembered, or linked) belong to the first cone, so the agent can write them, and to root while users are off.
173
173
  - **Files from before users:** agents start on the new layout; nothing is moved. On the first boot with users on, bios runs `chmod -R go-rwx` as root, once, on what earlier versions left readable to everyone: `/home/.pi`, `/home/.slicc`, `/home/sprinkles`, `/home/.gelatiere`, `/home/.welcomed`, `/home/.welcome.json`, `/home/sessions`, `/home/.local` and `/scoops`. So no cone or scoop reads an old `/home/.pi/agent/mcp.json` with its tokens, and root still reads everything. The marker `var/lib/slicc/legacy-locked` keeps it from running again; cone and scoop homes and other files in `/home` aren't touched.
174
- - **The agent's `KernelSource`** (`os/users.js`) passes `connect({ user, agentId })`, `users` and `groups` to the kernel, only for agent users. It refuses root and any user but `cone`, `cone-<n>` and `scoop-<folder>`, requires the agentId to match the user exactly (`cone:cone`, `cone:cone-2`, `scoop:<folder>`), and allows groups only of cones, `dialout` and, for cones only, `sudo`. A cone is always added to `sudo`, even when the caller leaves it out, since sudo membership is what makes a cone (the vault's J2 rule). The tag is `{"kind":"agent","agentId":…}` as JSON, and the agent's root client carries `{"kind":"agent","agentId":"root"}`; a panel terminal's is `{"kind":"user","where":"terminal:<tab>"}`.
174
+ - **The agent's `KernelSource`** (`os/users.js`) passes `connect({ user, agentId })`, `users` and `groups` to the kernel, only for agent users. It refuses root and any user but `cone`, `cone-<n>` and `scoop-<folder>`, requires the agentId to match the user exactly (`cone:cone`, `cone:cone-2`, `scoop:<folder>`), and allows groups only of cones, `dialout`, `plugdev` and, for cones only, `sudo`. A cone is always added to `sudo`, even when the caller leaves it out, since sudo membership is what makes a cone (the vault's J2 rule). The tag is `{"kind":"agent","agentId":…}` as JSON, and the agent's root client carries `{"kind":"agent","agentId":"root"}`; a panel terminal's is `{"kind":"user","where":"terminal:<tab>"}`.
175
175
  - **Protected code paths:** under `'enforce'`, the kernel gets `protect: { paths: ['/node_modules', '/opt/agent', '/opt/tailscale', '/opt/slicc', '/os'], writers: ['bios-installer'] }` (slicc-kernel ≥ 1.81.0). No process changes them, root included (`EROFS`; a cone sees `EACCES` first), and nothing mounts at, under or above them.
176
176
  - **bios's installs** (pnpm into the base set, `/opt/*` and `/opt/slicc/<project>`, and the pass that makes them readable) run as `kernel.run(argv, { cwd, tag: 'bios-installer', env })`. The env is clean: `HOME=/opt/slicc/.installer`, its own config and cache, the system `PNPM_HOME` and `PATH`, and an empty `NODE_OPTIONS`.
177
177
  - **pnpm runs with** `--ignore-scripts --ignore-pnpmfile --config.userconfig=/dev/null --config.store-dir=/opt/slicc/.store --config.verify-store-integrity=true`. No locked package in the base set, `/opt/agent`, `/opt/tailscale` or the data tools has an install script.
@@ -442,7 +442,7 @@ Programs ask seven's page for what only a page can do through the kernel's `/dev
442
442
  - **`open.url`** (`{"kind":"open.url","url":"…"}`, an empty reply) opens the URL in a new tab with `noopener,noreferrer`; `background` is ignored. Refusals, all `EACCES`, with this first line: `that isn't a URL`; `seven opens only http and https URLs` (`javascript:`, `data:`, `blob:`, `file:` and the rest); `seven doesn't open its own pages or the vault for a program` (the guard's protected origins: seven's own origin, `*.sliccy.ai` and the vault); `the request to open the page was dismissed`; `nobody answered the request to open the page within 60 s`. For example: `printf '{"kind":"open.url","url":"%s"}\n' "$url" | cat > /dev/embedder`.
443
443
  - **Tool modules** (capture, audio, devices) export the kernel's hook object `{ kinds, handle }`. `plugged(hook, prompts, extra, guard)` wraps one: only kinds seven lists and gives a prompt for reach it, and its `handle` runs only after seven's gesture check (or, for a capture, the capture steps below), with the request plus seven's `extra`. A module is a pinned, gated dependency in the base set, since it runs as seven.
444
444
  - **Capture** (`capture.screen`, `capture.camera`, `audio.record`, and an `audio.transcribe` that listens, the same ones that get "Use the microphone?" below; `captures()` in `src/seed/requests.js`) goes through four steps in this order, and each one can refuse with `EACCES` before the next:
445
- 1. **The off switch** (`src/seed/switches.js`, `switches.add({ key, label, off() }) → { on() }`): Settings lists Camera, Microphone and Screen (and Serial ports, see below) under "Capture and devices" (spectrum's `switches` port), all on by default. They are kept in the page's `localStorage` (`slicc-os.switches`), outside the kernel's file system, so no program can flip one, and every tab follows a change through the `storage` event. When the page can't write that storage, the switch still changes in this tab and still ends what is live. A request whose kind is switched off is refused at once with `<what> capture is off in seven's settings` (a screen or camera recording with the microphone needs both). Microphone covers every request that opens the microphone: `audio.record` and a listening `audio.transcribe` (Web Speech, or an engine that gets no audio in its body); probes, status, warm-up and listing microphones don't open it and still answer. Camera covers `capture.camera`; listing devices (`capture.devices`) opens none and still answers. Turning one off ends every live capture under it, in every tab (Microphone ends a camera recording with the microphone too), and a request still waiting for the agent, the prompt or its click is refused once the wait ends.
445
+ 1. **The off switch** (`src/seed/switches.js`, `switches.add({ key, label, off() }) → { on() }`): Settings lists Camera, Microphone and Screen (and Serial ports and USB devices, see below) under "Capture and devices" (spectrum's `switches` port), all on by default. They are kept in the page's `localStorage` (`slicc-os.switches`), outside the kernel's file system, so no program can flip one, and every tab follows a change through the `storage` event. When the page can't write that storage, the switch still changes in this tab and still ends what is live. A request whose kind is switched off is refused at once with `<what> capture is off in seven's settings` (a screen or camera recording with the microphone needs both). Microphone covers every request that opens the microphone: `audio.record` and a listening `audio.transcribe` (Web Speech, or an engine that gets no audio in its body); probes, status, warm-up and listing microphones don't open it and still answer. Camera covers `capture.camera`; listing devices (`capture.devices`) opens none and still answers. Turning one off ends every live capture under it, in every tab (Microphone ends a camera recording with the microphone too), and a request still waiting for the agent, the prompt or its click is refused once the wait ends.
446
446
  2. **Consent:** for `capture.screen`, `capture.camera` and `audio.record`, seven asks the agent with `approveCapture({ kind, options, stamp, label? }, { signal, where? })` (`label` is the camera's or the microphone's name when seven can read it from `enumerateDevices()`; `where` names a linked device as for sudo). `once` or `always` goes on; `deny`, or `{ answer: 'deny', message }`, refuses with the message (`the request to capture was denied` without one). The agent answers `once` for any run no guest started and asks the guest's seat for one a guest started (see slicc-agent's README). When it can't answer (`EAGAIN`: not running, restarting, too old to have the method, kernel users off, or a guest seat without tool review), seven shows its own prompt, as before: "Capture the screen?", "Take a photo?", "Record the camera?" (or "Record the camera and microphone?", with "for up to N seconds" when `duration` is positive) or "Use the microphone?", with Choose, Take photo or Record and Cancel. Any other failure refuses with `the agent couldn't answer the request to capture`, and so does an agent that hasn't answered within 6 minutes (`ANSWER_MS`, the 5 minutes an approval waits for a person plus 60 s, so a working agent's own expiry answers first): seven then aborts the signal it handed the agent, opens nothing and shows no prompt of its own, and ignores a later answer. While the agent hasn't answered after 1 s, the program gets one line on stderr, `waiting for the agent to answer the request to capture`. A listening `audio.transcribe` isn't a capture kind for the agent, so it keeps seven's own "Use the microphone?" prompt.
447
447
  3. **The click** (`src/seed/clicks.js`, `clicks.ask({ kind, detail: { what, program }, asker, title, body, action, signal }) → Promise<void>`): after the agent's `once`, a command typed in an active tab goes straight on, and so does a camera or microphone recording when the browser's permission for every device it opens (`camera`, `microphone`) is `granted`. A state of `denied` refuses at once with `camera permission is blocked for this site` (or `microphone`). Otherwise a click in seven's tab can't be avoided (Chrome's picker always needs one, and so does the browser's own camera or microphone prompt), and seven shows a click request (`kind: 'click'`, spectrum's `ClickApproval`) in the approvals dialog: "Choose what to share?" with **Choose what to share**, "Allow the camera?" with **Allow camera** (one item, "Allow the camera and microphone?" with **Allow camera and microphone**, when a camera recording takes the microphone too), or "Allow the microphone?" with **Allow microphone**, and Cancel. The program gets `waiting for a click in seven's tab: choose what to share` (or `allow the camera`, `allow the camera and microphone`, `allow the microphone`) on standard error first. The click resolves inside its own user activation, so `getDisplayMedia` and `getUserMedia` run in it. Cancel refuses with the dismissed text, and 5 minutes without a click with `nobody clicked within 5 min`; the gesture rules hold (one at a time per session, 10 s of rest after a Cancel or a timeout). The tab that answers the request holds the click; seven's other tabs show it with `here: false` ("Click in seven's tab.") and can only cancel it. While the tab is hidden, its title starts with `● `, and seven raises a system notification when the site already may (it never asks for that permission). Linked follower devices aren't told yet.
448
448
  4. **The indicator** (`src/seed/live.js`, `live.add({ kind, label, what, asker, since, action: { label, run } }) → remove()`): while the request runs (the wait for a click doesn't count), spectrum's `live` port shows a chip, "Recording screen", "Recording camera" (`with microphone` when it takes the microphone), "Taking a photo" (a screen or camera still) or "Recording microphone" (a listening transcribe too), with who asked (the cone, `a terminal` or `a program`) and **Stop**, in every tab of this seven. Stop ends the request: a screen or camera recording ends as if Chrome's Stop sharing were pressed and a microphone recording or a Web Speech listen stops, so the program gets the end of the file and finalizes it; a still or a request still starting fails with `stopped in seven`. Linked follower devices don't see it yet.
@@ -464,6 +464,10 @@ Programs ask seven's page for what only a page can do through the kernel's `/dev
464
464
  - **The click:** `serial.request` is the only kind that can ask, and the browser's chooser is the only prompt. Typed in an active tab, it opens Chrome's chooser at once. Otherwise the program gets `waiting for a click in seven's tab: choose a serial port` on standard error, and seven shows a click request (`clicks.ask` with `kind: 'device'` and `detail: { what: 'serial', program }`): "Choose a serial port", "<asker> wants to use a serial port. Click Choose, then pick it in the browser's list.", with **Choose…** and Cancel. Choose opens the chooser inside that click. Cancel refuses with `no serial port was chosen`, and 300 s without a click with `nobody clicked within 5 min`, both `EACCES`. The click's one-at-a-time and 10 s rest rules apply, and so do its hidden-tab notices.
465
465
  - **The indicator:** while a port is open, the live port shows "Serial port open", the handle and who opened it (the cone, `a terminal` or `a program`), with **Close**. Close closes the port in seven: a `serial read --follow` ends at end of file, and later requests fail with `EIO` (`serial1 was closed in seven`). The chip goes when the port closes, however it closes: `serial close`, Close, the switch, or unplugging.
466
466
  - **The switch:** "Serial ports" sits beside Camera, Microphone and Screen, on by default and kept in the same `slicc-os.switches`. Off refuses every `serial.*` kind with `serial ports are off in seven's settings` (`EACCES`), before the chooser or the port is touched, and turning it off closes every open port, in every tab. A `serial open` or a chooser still in flight when it turns off is refused the same way (slicc-devices ≥ 1.0.2): the port is closed again, and a port the browser granted meanwhile is listed closed, with nothing buffered, once the switch is back on.
467
+ - **USB devices** (`usb`, `@ai-ecoverse/slicc-devices/page` ≥ 1.4.0, slicc-kernel ≥ 1.191.0, WebUSB; `src/seed/usb.js`, wired with the serial ports in `serialPorts()` in `src/seed/serial.js`, since one `create()` answers both): seven lists the module's `usb.*` kinds with the policies it exports. `usb.list`, `usb.request`, `usb.open`, `usb.close`, `usb.claim`, `usb.release` and `usb.transfer.in` have `{ group: 'plugdev', session: false }`, so every cone and scoop (see [Kernel users](#kernel-users)) lists, chooses, opens, claims and reads a device. `usb.select`, `usb.reset`, `usb.clear-halt`, `usb.transfer.out` and `usb.control` have `{ session: false }`: everything that can hurt a device, and every control transfer, IN included, as Linux asks write access for one, is root's only, so an agent runs `sudo usb …` and sudo's judge decides. A cone gets `EACCES` (`usb.transfer.out is not allowed for this user`) before the page sees the request, and a scoop, with no `sudo`, reads and can't write. A claim is held by who made it (the agent, the person's terminal, or a uid), which survives `sudo`, so an agent claims an interface as itself and writes to it with `sudo usb transfer-out`. A claim held by someone else, an unclaimed interface and a device busy elsewhere are `EBUSY` (slicc-devices ≥ 1.4.0 on slicc-kernel ≥ 1.191.0). The module numbers devices `usb1`, `usb2`, … for that page's lifetime (see slicc-devices' README). USB device files (`/dev/bus/usb/…`, usbfs for libusb) are not provided: programs that want libusb don't work.
468
+ - **The click:** `usb.request` is the only USB kind that can ask, as `serial.request` does: typed in an active tab it opens Chrome's chooser at once; otherwise the program gets `waiting for a click in seven's tab: choose a USB device` and seven shows a click request (`clicks.ask` with `kind: 'device'` and `detail: { what: 'usb', program }`): "Choose a USB device", "<asker> wants to use a USB device. Click Choose, then pick it in the browser's list.", with **Choose…** and Cancel. Cancel refuses with `no USB device was chosen` and 300 s without a click with `nobody clicked within 5 min`, both `EACCES`.
469
+ - **The indicator:** while a device is open, the live list shows "USB device open", the handle with its ids and product name (`usb1 (0x2341:0x0043 Arduino Uno)`) and who opened it, with **Close**, which closes the device in seven. The chip goes when the device closes, however it closes: `usb close`, Close, the switch, or unplugging.
470
+ - **The switch:** "USB devices" sits after Serial ports, on by default and kept in the same `slicc-os.switches`. Off refuses every `usb.*` kind with `USB devices are off in seven's settings` (`EACCES`), before the chooser or the device is touched, and turning it off closes every open device and refuses an open, a request or a transfer still in flight.
467
471
  - Kinds seven doesn't list (`open.file`, `open.download`, `open.reveal`, `clipboard.read`) are `ENOTSUP` before the page sees them.
468
472
 
469
473
  ### Composer recording
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
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",