@ai-ecoverse/slicc-bios 2.0.0 → 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.
- package/README.md +11 -7
- 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 `
|
|
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
|
|
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
|
|
@@ -637,13 +641,13 @@ seven can also join a tailnet, with a patched build of Tailscale's wasm client (
|
|
|
637
641
|
- Each `OPEN { kind: 'agent', op }` goes to the agent of the tab that runs the kernel, on its active cone, through slicc-agent's `remoteControl`. `prompt` answers OPENED with how the prompt was delivered (or `RESET EBUSY` for `whenBusy: 'reject'` while busy), then streams NDJSON events from the prompt's own `user` event to its `end` line. A prompt over about 60 KiB comes as `length` bytes after an empty OPENED, and the first line then says how it was delivered. `watch` answers with the transcript `head` (and `gap` when `since` is gone), then streams events. A `watch` OPEN with `busy: true` (`slicc wait`, `slicc prompt --allsettled`) also asks the agent whether it has anything left to do: OPENED then carries `busy: true | false`, and a `{"t":"busy","busy","why"?}` line follows each time that changes. `abort` answers `{ aborted }`.
|
|
638
642
|
- `inventory` (slicc-cli's `slicc agents`, slicc-agent ≥ 7.12.0) answers OPENED with a snapshot of that cone's agents and its live scoops, and with `watch: true` it streams a whole new one as `{"t":"inventory",…}` on each change, at most one every 250 ms, the latest always sent, and the current one again every 30 s; the timers run only while such a stream is open. Each snapshot is `{ v: 1, instance, seq, changedAt, reportedAt, counts, agents }`, built field by field from slicc-agent's, so nothing else gets through: at most 256 agents, and a `provider` or `model` over 128 characters is left out. One line is written at a time; a change while one waits for the CLI to read only marks the latest snapshot to go next. `instance.id` is 16 random bytes minted once per profile into `slicc-os.inventory`, with a second random key beside it that never leaves the page; `instance.name` is the HELLO's name. An agent's `id` and `parent` are the first 16 bytes of HMAC-SHA-256 under that key of slicc-agent's registry id, so they stay the same for the profile and carry no scoop or cone name. An agent without the inventory answers `EOPNOTSUPP: this agent has no inventory`, and a tab without the agent, a follower included, `EOPNOTSUPP: the agent is not running`. Watching agents doesn't count as **Watching**.
|
|
639
643
|
- `approvals` and `decide` (slicc-cli's `slicc approvals` and `slicc decide`, slicc-agent ≥ 7.36.0; seven pins 7.39.0) list and answer the agent's approvals from a linked device, through slicc-agent's `approvals({ watch })` and `decide({ id, answer, reason })`, behind the same Control permission as `prompt` (`EACCES` without it). `approvals` answers OPENED `{ approvals: [Item, …] }`, the pending items on the `user` tier, oldest first, passed on as the agent gives them, then END; with `watch: true` a `{"t":"approvals","approvals":[…]}` line carries each new snapshot, and a watch the node closes or resets gives up its subscription and its agent connection at once, even while nothing changes. `decide` takes `id`, `answer` (`once`, `always`, `deny` or `stop`) and an optional string `reason`, anything else being `EINVAL` with a sentence (`decide needs an approval id`, `the answer is once, always, deny or stop`, `a reason is text`), since a bare `EINVAL` tells the CLI seven doesn't know the op, and answers OPENED `{ ok: true }` then END; the agent's refusal is the RESET as it is (`EINVAL: <its sentence>`, `ENOENT` for an unknown id, `EACCES: <its sentence>` on a view-only connection, `EOPNOTSUPP: this agent has no approvals` from an agent without `decide`). The remote client is built with `device`, the link's device id (a device the port itself carries wins; bios's `owner.port()` carries none) (its certificate fingerprint, or its link key for an unpaired local CLI), so the agent records `decidedBy: 'follower'` and that device. An agent without them answers `EOPNOTSUPP: this agent has no approvals`.
|
|
640
|
-
- **Never self-approval:** `decide` is refused with `EACCES: a link from this seven's own kernel can't decide approvals` on
|
|
644
|
+
- **Never self-approval:** `decide` is refused with `EACCES: a link from this seven's own kernel can't decide approvals` on any link identified as from this seven's own kernel, for the whole life of that link. Such a link carries one of this seven's own certificates, the ones its in-kernel `slicc` dials trays with (`link:<hub>` in the IndexedDB database `slicc-follow`; see *Sevens this kernel follows*). A device's id on the tray is the SHA-256 fingerprint of its certificate, so seven compares it with the fingerprints it keeps (`keptFingerprints('link:')`) once when the link is identified (`links.identify`), keeps that answer on the link until it closes, and compares again on each `decide` before the agent is asked; either saying own refuses, and a check that fails on `decide` refuses too. When the check fails as the link is identified, `decide` is refused with `EACCES: seven couldn't check this device when it linked; reconnect it to decide approvals`: the device is checked again when it reconnects. A kernel program can't send `decide` at all: the link facade never opens it (`NO_DECIDE`, below). A privileged program (root or a member of `sudo`, the only callers the facade admits, so a cone needs an approved `sudo` first) can still have this seven mint a new `link:<hub>` certificate by re-linking, and that no longer matters: the answer was decided when the link was identified, and the fingerprint of a replaced or deleted certificate is retired, not dropped (`retired:<key>` in the same store, which `keptFingerprints` counts), for a year and for as long as a link carries it. At most 256 retired fingerprints are kept per key; the oldest that no link carries go first.
|
|
641
645
|
- A CLI that goes away ends its stream but never aborts the run; aborting is explicit. A `watch` the CLI half-closes right after OPENED, as slicc does, still ends at once when it is later reset or its link closes, so **Watching** clears without waiting for the agent's next event.
|
|
642
646
|
- Linked devices lists every device that has linked, offline ones too, with its control setting, and shows **Prompting** or **Watching** while a CLI does, also in the header.
|
|
643
647
|
- A device that reconnects replaces only its own process's link, so `slicc <join> prompt` doesn't drop that machine's `follow`. Control-only links (`caps: []`) get no `.slicc.internal` name and no exit.
|
|
644
648
|
- **Folders (`fs`):** a CLI started with `--mount <path>[:<name>][:ro]` lists its folders in HELLO, and later in `OPEN { kind: 'mounts' }` updates; the page offers cap `mounts`. Each is a `hostfs` source named `<device>/<name>`, so `mount -t hostfs lars-mbp/proj /mnt/proj` mounts it, and nothing is mounted unless someone asks. A bare source with no `<device>/` (`mount -t hostfs project /mnt/p`, or one remembered from an older seven), is the folder of that name on the CLI linked on this computer, when exactly one local CLI shares one. The device's row in Linked devices lists its folders (`folders`, with a Read-only badge; spectrum ≥ 1.58.0): **Mount** (`mountFolder(source)`) mounts one at `/mnt/<device>/<name>` (a folder named `.` or `..` is never listed), and **Eject** (`ejectFolder(source)`) unmounts it. The Files panel's Mounted strip shows each `hostfs` mount's source (`mountInfo()`), so `/mnt/proj · lars-mbp/proj` reads as another computer's folder. A mounted linked folder stays with the CLI process it was first granted from (`slicc-os.link-sources`), even if that process comes back under another name. If that process isn't linked, the folder goes to whichever process has the name now, but only when no other process with the same host name shares a folder of that name; otherwise it waits. So a remembered `lars-mbp/proj` never lands on another process's `proj`. A remembered linked folder that is mounted again before its CLI is back stays `nomedium`, and fills in when the CLI links. The kernel's `hostfs` hook answers such a source with a `MessagePort` (slicc-kernel ≥ 1.54.9), and the page serves it with `serveHostfsPort` over `OPEN { kind: 'fs', mount, op, … }` streams: `list` collects its NDJSON, a read over 64 KiB and every write get their own channel, and `watch` streams the CLI's change events. A read-only kernel mount, or a read-only export, sends `readonly: true` on every OPEN. A link that drops makes the mount `nomedium` until the CLI is back; files that were open reopen by path and continue if the host didn't change them.
|
|
645
649
|
- **SSH host key:** the CLI's HELLO carries its host key, and the page writes `<host>.slicc.internal,<address> <key>` into the system-wide `/etc/ssh/ssh_known_hosts`, replacing older entries for that name or address, so `ssh` never trusts a key on first sight, whichever user runs it. Seven manages these keys, not the user, and OpenSSH looks up a user's own file under the passwd home, which isn't always `$HOME`.
|
|
646
|
-
- **Tests:** `test/integration/agent-approvals.test.mjs` runs against seven's real agent: a tab of seven's origin links two devices to seven's own tray on a fake hub the way the in-kernel `slicc` does, one with this seven's `link:<hub>` certificate and one with another. Both get `EACCES` until Control. A cone's `sudo` then shows up in `approvals` as a pending `user`-tier item, and only the device with the other certificate can `decide` it: a `deny` ends the `sudo` with exit 1, a `watch` gets a new snapshot without the item, and a second answer is refused with the agent's sentence. The own-kernel device's `decide` is refused before the agent is asked, an unknown id is `ENOENT` and a bad answer `EINVAL` with its sentence. `test/integration/agent-approvals-link.test.mjs` covers, against a stubbed client, the refusals the real agent doesn't easily produce (view-only `EACCES`, `EOPNOTSUPP`), a failing own-kernel check, an idle `watch` closed by the node releasing its subscription and connection at once, and the link facade opening `approvals` but never `decide`. `test/integration/remote.test.mjs` runs the real `slicc watch`, `slicc prompt`, `slicc abort` and `slicc wait` with `--signal stdio` against seven's real agent and a fake Bedrock; `slicc wait` keeps waiting while a held model answer keeps the agent busy, and exits once it is idle. It also leads a fake tray hub and sends a `webhook.event`, which reaches the agent as a webhook lick (without its `authorization` header) and starts a run. `test/integration/tray.test.mjs` leads a fake tray hub and links a follower in the page through it, then rotates and unlinks; a remote follower that names kernel port 17180 leaves `SLICC_PAGE_LOOPBACK`, the stored port and the profile script alone. `test/integration/link-rehello.test.mjs` links fake nodes in the page over real `RTCPeerConnection`s. It makes seven's side report ICE `failed`, closes the node's side without a `bye`, and then sends a new `hello` while a stale link is still up and a second process waits for the name. Each time it checks that seven opens no peer connection and sends no offer of its own after a close, offers once to the new nonce, keeps the name and address, carries kernel `curl` over the new link, and ignores an `answer`, a candidate and a `bye` under the old nonce. `test/integration/link.test.mjs` links a fake node in the page over a real `RTCPeerConnection`, with a HELLO that names no kernel port, port 80 or 17180, and checks `SLICC_PAGE_LOOPBACK` in login shells and, after a reload, in every program (one that offers `cdp` as version `1.47.2` or without a version shares no browsers while its net and folders still work; `1.47.3`, `dev` and a pseudo-version above share them), and, with `SLICC_CLI` set, the real `slicc attach --signal stdio`, relaying its NDJSON through the CDP binding: raw TCP and the http kind; kernel `ssh` with strict host-key checking against `--runner sh -c`, after `pnpm add -g @ai-ecoverse/wasix-openssh`; and, with the link as the exit, a name from the CLI's `--hosts` file, then refused under `--deny`; and `<port>.kernel.localhost` through the CLI's listener into a kernel server (`httptest`), with 502 for a closed port and the facade refused; a folder shared with `--mount`, mounted as `ref-node/proj`, read, written, seen changing on the host, and refused for writes when mounted `ro`; a second headless Chromium shared with `--cdp-extra`, listed and driven by `playwright-cli --runtime ref-node/<id>`; and a program WebSocket from kernel `bash` through the proxy to a `ws` echo server on the CLI's loopback: text, binary, the subprotocol, a close from each end, and `EACCES` under `--deny`; kernel `websocat`, installed from the catalog, to a `ws` echo on the CLI's loopback and, without `-k`, to `wss://echo.sliccy.ai/` (SLICC's echo, behind Cloudflare's certificate), so its own TLS checks the chain over raw TCP through the link, then failing at once under Directly and with no exit; and a kernel `python3` UDP socket (after `pnpm add -g @ai-ecoverse/wasix-python`) to a UDP echo server on the CLI's loopback, unconnected and connected, and `EACCES` on a connected socket under `--deny`, as with the fake node's own refusal. CI runs the CLI from npm, the pinned `@ai-ecoverse/slicc` devDependency.
|
|
650
|
+
- **Tests:** `test/integration/agent-approvals.test.mjs` runs against seven's real agent: a tab of seven's origin links two devices to seven's own tray on a fake hub the way the in-kernel `slicc` does, one with this seven's `link:<hub>` certificate and one with another. Both get `EACCES` until Control. A cone's `sudo` then shows up in `approvals` as a pending `user`-tier item, and only the device with the other certificate can `decide` it: a `deny` ends the `sudo` with exit 1, a `watch` gets a new snapshot without the item, and a second answer is refused with the agent's sentence. The own-kernel device's `decide` is refused before the agent is asked, also after the tab renews its `link:<hub>` certificate early (a clock a year ahead) while the link stays up, when the replaced fingerprint is still among those kept and the other device is unaffected, and again once the link is dialled with the new certificate (a new device, granted Control), and after 296 re-links on its hub, which keep 256 retired fingerprints, the live link's among them, and prune only fingerprints no live link carries; an unknown id is `ENOENT` and a bad answer `EINVAL` with its sentence. `test/integration/agent-approvals-link.test.mjs` covers, against a stubbed client, the refusals the real agent doesn't easily produce (view-only `EACCES`, `EOPNOTSUPP`), a failing own-kernel check, a link identified as own that stays refused when the kept fingerprints change under it while a foreign link still decides and a link with the new fingerprint is refused, a foreign link whose check failed when it was identified refused with the reconnect sentence until it reconnects, an own one refused as own, an idle `watch` closed by the node releasing its subscription and connection at once, and the link facade opening `approvals` but never `decide`. `test/integration/remote.test.mjs` runs the real `slicc watch`, `slicc prompt`, `slicc abort` and `slicc wait` with `--signal stdio` against seven's real agent and a fake Bedrock; `slicc wait` keeps waiting while a held model answer keeps the agent busy, and exits once it is idle. It also leads a fake tray hub and sends a `webhook.event`, which reaches the agent as a webhook lick (without its `authorization` header) and starts a run. `test/integration/tray.test.mjs` leads a fake tray hub and links a follower in the page through it, then rotates and unlinks; a remote follower that names kernel port 17180 leaves `SLICC_PAGE_LOOPBACK`, the stored port and the profile script alone. `test/integration/link-rehello.test.mjs` links fake nodes in the page over real `RTCPeerConnection`s. It makes seven's side report ICE `failed`, closes the node's side without a `bye`, and then sends a new `hello` while a stale link is still up and a second process waits for the name. Each time it checks that seven opens no peer connection and sends no offer of its own after a close, offers once to the new nonce, keeps the name and address, carries kernel `curl` over the new link, and ignores an `answer`, a candidate and a `bye` under the old nonce. `test/integration/link.test.mjs` links a fake node in the page over a real `RTCPeerConnection`, with a HELLO that names no kernel port, port 80 or 17180, and checks `SLICC_PAGE_LOOPBACK` in login shells and, after a reload, in every program (one that offers `cdp` as version `1.47.2` or without a version shares no browsers while its net and folders still work; `1.47.3`, `dev` and a pseudo-version above share them), and, with `SLICC_CLI` set, the real `slicc attach --signal stdio`, relaying its NDJSON through the CDP binding: raw TCP and the http kind; kernel `ssh` with strict host-key checking against `--runner sh -c`, after `pnpm add -g @ai-ecoverse/wasix-openssh`; and, with the link as the exit, a name from the CLI's `--hosts` file, then refused under `--deny`; and `<port>.kernel.localhost` through the CLI's listener into a kernel server (`httptest`), with 502 for a closed port and the facade refused; a folder shared with `--mount`, mounted as `ref-node/proj`, read, written, seen changing on the host, and refused for writes when mounted `ro`; a second headless Chromium shared with `--cdp-extra`, listed and driven by `playwright-cli --runtime ref-node/<id>`; and a program WebSocket from kernel `bash` through the proxy to a `ws` echo server on the CLI's loopback: text, binary, the subprotocol, a close from each end, and `EACCES` under `--deny`; kernel `websocat`, installed from the catalog, to a `ws` echo on the CLI's loopback and, without `-k`, to `wss://echo.sliccy.ai/` (SLICC's echo, behind Cloudflare's certificate), so its own TLS checks the chain over raw TCP through the link, then failing at once under Directly and with no exit; and a kernel `python3` UDP socket (after `pnpm add -g @ai-ecoverse/wasix-python`) to a UDP echo server on the CLI's loopback, unconnected and connected, and `EACCES` on a connected socket under `--deny`, as with the fake node's own refusal. CI runs the CLI from npm, the pinned `@ai-ecoverse/slicc` devDependency.
|
|
647
651
|
- **As the exit:** a CLI linked on this computer (`npx sliccy@next`) is the exit by itself until the user chooses one, so the kernel's HTTP and raw TCP get past CORS at once; a Tailscale exit node that is on comes first. A remote device that offers to be a default exit carries other traffic only once it's chosen. The Network panel's **Internet traffic** picker (`setExit`) is one choice across Directly, Tailscale exit nodes and linked devices: choosing a device turns off Tailscale's exit node, and choosing Tailscale clears the device. The choice of a device is kept in `localStorage` (`slicc-os.exit`), and while that device isn't connected, after a reload or while it reconnects, internet traffic **waits**: raw connections get `ENETUNREACH` and HTTP fails, rather than going out directly. Choosing Directly sends it directly again and is kept (`direct`), so a local CLI doesn't take it over, while a Tailscale exit node turned on later still does; unlinking the chosen exit device goes back to the automatic choice.
|
|
648
652
|
- **What the agent sees:** the transport's `traits` name the default exit while there is one, so the agent can say how its fetches go. `traits.exit` is `{ kind, caps }`:
|
|
649
653
|
- **`kind`:** `local` (a CLI on this computer), `remote` (a chosen linked device) or `tailnet` (a Tailscale exit node);
|