@ai-ecoverse/slicc-bios 2.3.0 → 2.4.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
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, USB devices and
|
|
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, USB devices, HID devices and Bluetooth 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`, `esptool`, `usb` 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`, `usb`, `hid` and `ble` 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 })` and `kernel.groups.add('
|
|
171
|
+
- **Device groups** (slicc-kernel ≥ 1.176.0): at every boot, after the first cone, bios calls `kernel.groups.add('dialout', { gid: 20 })`, `kernel.groups.add('plugdev', { gid: 46 })` and `kernel.groups.add('bluetooth', { gid: 110 })` (the kernel's default `/etc/group` leaves 110 free), since an `/etc/group` from an older kernel or an older seven lacks them, and adds every `cone`, `cone-<n>` and `scoop-<folder>` user to all three (`deviceGroups()` in `os/users.js`). Every user the agent adds through its `KernelSource` gets `dialout`, `plugdev` and `bluetooth` too, scoops included, so every agent can read the serial ports, USB devices, HID devices and Bluetooth devices and none can write to one without `sudo` (see [Serial ports, USB, HID and Bluetooth 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`, `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>"}`.
|
|
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`, `bluetooth` 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.
|
|
@@ -287,7 +287,7 @@ Before that, seven installed `@shikijs/langs` and `@shikijs/themes` as a pnpm pr
|
|
|
287
287
|
|
|
288
288
|
#### No agent older than the profile
|
|
289
289
|
|
|
290
|
-
An agent's session database can migrate one way: from slicc-agent 7.0, pi-durable schema 2, which a 6.x agent can't open. slicc-agent 8.x (Chord v2) keeps schema 2, so a 7.x agent still opens a profile an 8.x agent used. So before `startChat` starts an agent, bios (`os/durable.js`) compares the agent's schema (6.x is 1, 7.x and 8.x are 2, and a later major counts as able to open any profile, since this seven can't know its schema) with the profile's: the higher of the agent's own marker, `/.slicc/agent-profile.json` `{ durableSchema }`, and bios's record of the highest schema it has started on this origin (`localStorage` `slicc-os.agent-schema`, written before the start, so it covers an agent that never wrote the marker). Only a missing file or `.slicc` folder means no marker; a marker that can't be read or parsed counts as schema 2, the highest this seven knows, so 6.x isn't started and 7.x or 8.x may be. An older agent isn't started: the Agent row fails and a notice says why, and the newer agent's data stays as it is. No marker and no record start any agent. A first start of the pinned agent on a profile a 6.x agent used upgrades that profile one way; the agent writes the marker and bios records 2. Going back from 8.x to 7.x (a downgrade of seven's pin) keeps 2, so 7.x starts.
|
|
290
|
+
An agent's session database can migrate one way: from slicc-agent 7.0, pi-durable schema 2, which a 6.x agent can't open. slicc-agent 8.x (Chord v2) keeps schema 2, so a 7.x agent still opens a profile an 8.x agent used. So before `startChat` starts an agent, bios (`os/durable.js`) compares the agent's schema (6.x is 1, 7.x and 8.x are 2, and a later major counts as able to open any profile, since this seven can't know its schema) with the profile's: the higher of the agent's own marker, `/.slicc/agent-profile.json` `{ durableSchema }`, and bios's record of the highest schema it has started on this origin (`localStorage` `slicc-os.agent-schema`, written before the start, so it covers an agent that never wrote the marker). Only a missing file or `.slicc` folder means no marker; a marker that can't be read or parsed counts as schema 2, the highest this seven knows, so 6.x isn't started and 7.x or 8.x may be. Along with the record, bios keeps which agent it recorded it for (`slicc-os.agent-schema-by`, `{ schema, agent }`), and judges that agent again with what it knows now, so a record of 3 that a seven wrote for a major it didn't know yet drops to that major's schema once seven knows it. A record above 2 that names no agent is from a seven before this one (one that didn't know 8.x yet recorded 3 for slicc-agent 8.0.0, which then locked 8.0.0 out once seven shipped it); since every agent from 7.x writes the marker, never lowered, before pi durable opens the database, a readable marker decides instead, and the next start writes the record again. Without a marker such a record still counts. An older agent isn't started: the Agent row fails and a notice says why, and the newer agent's data stays as it is. No marker and no record start any agent. A first start of the pinned agent on a profile a 6.x agent used upgrades that profile one way; the agent writes the marker and bios records 2. Going back from 8.x to 7.x (a downgrade of seven's pin) keeps 2, so 7.x starts.
|
|
291
291
|
|
|
292
292
|
#### Developer mode and agent betas
|
|
293
293
|
|
|
@@ -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, USB devices and
|
|
445
|
+
1. **The off switch** (`src/seed/switches.js`, `switches.add({ key, label, off() }) → { on() }`): Settings lists Camera, Microphone and Screen (and Serial ports, USB devices, HID devices and Bluetooth 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.
|
|
@@ -472,6 +472,10 @@ Programs ask seven's page for what only a page can do through the kernel's `/dev
|
|
|
472
472
|
- **The click:** `hid.request` is the only HID kind that can ask, as `usb.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 HID device` and seven shows a click request (`clicks.ask` with `kind: 'device'` and `detail: { what: 'hid', program }`): "Choose a HID device", "<asker> wants to use a HID device. Click Choose, then pick it in the browser's list.", with **Choose…** and Cancel. Cancel refuses with `no HID device was chosen` and 300 s without a click with `nobody clicked within 5 min`, both `EACCES`.
|
|
473
473
|
- **The indicator:** while a device is open, the live list shows "HID device open", the handle with its ids and product name (`hid1 (0x320f:0x5044 Nano Pad)`) and who opened it, with **Close**, which closes the device in seven and ends a `hid watch` on it. The chip goes when the device closes, however it closes: `hid close`, Close, the switch, or unplugging.
|
|
474
474
|
- **The switch:** "HID devices" sits after USB devices, on by default and kept in the same `slicc-os.switches`. Off refuses every `hid.*` kind with `HID devices are off in seven's settings` (`EACCES`), before the chooser or the device is touched, and turning it off closes every open device, ends every `hid watch` with that error and refuses an open, a request or a send still in flight.
|
|
475
|
+
- **Bluetooth devices** (`ble`, `@ai-ecoverse/slicc-devices/page` ≥ 1.6.0, Web Bluetooth; `src/seed/ble.js`, wired with the others in `serialPorts()` in `src/seed/serial.js`): seven lists the module's `ble.*` kinds with the policies it exports. `ble.list`, `ble.request`, `ble.connect`, `ble.disconnect`, `ble.services`, `ble.read` and `ble.notify` have `{ group: 'bluetooth', session: false }`, so every cone and scoop (see [Kernel users](#kernel-users)) lists, chooses, connects, reads a device's services, characteristics and descriptors, and follows its notifications (enabling them writes the device's notification descriptor, which counts as a read stream). `ble.write` has `{ session: false }`: anything written to a characteristic is root's only, so an agent runs `sudo ble write …` and sudo's judge decides. A cone gets `EACCES` (`ble.write is not allowed for this user`) before the page sees the request, and a scoop, with no `sudo`, reads and can't write. The module numbers devices `ble1`, `ble2`, … for that page's lifetime (see slicc-devices' README). What Web Bluetooth can't do, seven can't either: it is a GATT client (central) only, with no scanning (`requestLEScan`) or advertisements, no peripheral role and no Bluetooth Classic; a program can use only the services it listed when the device was chosen (`ble request --service …`), Chrome refuses blocklisted GATT services (HID over GATT among them) with its own text, and grants last for the page load unless Chrome offers `getDevices()`, so after a reload a device may have to be chosen again. There is no Bluetooth device file.
|
|
476
|
+
- **The click:** `ble.request` is the only Bluetooth kind that can ask, as `hid.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 Bluetooth device` and seven shows a click request (`clicks.ask` with `kind: 'device'` and `detail: { what: 'ble', program }`): "Choose a Bluetooth device", "<asker> wants to use a Bluetooth device. Click Choose, then pick it in the browser's list.", with **Choose…** and Cancel. Cancel refuses with `no Bluetooth device was chosen` and 300 s without a click with `nobody clicked within 5 min`, both `EACCES`.
|
|
477
|
+
- **The indicator:** while a device is connected, the live list shows "Bluetooth device connected", the handle with its name (`ble1 (Polar H10)`) and who connected it, with **Close**, which disconnects the device in seven and ends a `ble notify` on it. The chip goes when the device disconnects, however it ends: `ble disconnect`, Close, the switch, or the device going away.
|
|
478
|
+
- **The switch:** "Bluetooth devices" sits after HID devices, on by default and kept in the same `slicc-os.switches`. Off refuses every `ble.*` kind with `Bluetooth devices are off in seven's settings` (`EACCES`), before the chooser or the device is touched, and turning it off disconnects every device, ends every `ble notify` with that error and refuses a request, a connect or a write still in flight.
|
|
475
479
|
- Kinds seven doesn't list (`open.file`, `open.download`, `open.reveal`, `clipboard.read`) are `ENOTSUP` before the page sees them.
|
|
476
480
|
|
|
477
481
|
### Composer recording
|
|
@@ -871,7 +875,7 @@ The hosts are served by the [sliccy-ai](https://github.com/ai-ecoverse/sliccy-ai
|
|
|
871
875
|
- The bucket expires everything under `branches/` 30 days after upload. Every push uploads all files again, so a branch stays up while it's active and disappears a month after its last push. Nothing needs to be cleaned up when a branch is deleted.
|
|
872
876
|
- **seven** is published only by a release. On a push to `main`, the pipeline's release job runs semantic-release in the `production` environment, and when that tags a new `v<version>` its `after-release` command runs `edge/publish.mjs main`, which uploads `seven/`. A push that releases nothing (`chore:`, `ci:`, `docs:`, `test:` and the like) publishes nothing, so a change that only matters to seven needs a `fix:` or `feat:` commit to go live. A release job is never cancelled by a newer one.
|
|
873
877
|
- The upload goes over R2's S3-compatible API with `SLICC_BIOS_DEPLOY_TOKEN`, a Cloudflare API token with only Workers R2 Storage Bucket Item Read and Write on the `slicc-bios` bucket (Cloudflare honours bucket-scoped tokens on the S3 API only, not the REST API that `wrangler r2 object` uses). `edge/publish.mjs` derives the S3 credentials in the release job, in memory: it asks Cloudflare's token verify endpoint for the token's id (the access key id) and hashes the token with SHA-256 (the secret access key, as Cloudflare defines it), and signs each request with SigV4 through [aws4fetch](https://github.com/mhart/aws4fetch). Neither is printed or written anywhere. Files go up eight at a time, then deletions, then the manifest. That token could overwrite `seven/`, so it lives only in the `production` environment, whose deployment branch policy allows `main` alone, and `ci.yml` gives it only to the release job (`release-secrets`). The pipeline keeps its own `CLOUDFLARE_API_TOKEN`, the reviewers' screenshot token, out of `after-release`, hence the separate name.
|
|
874
|
-
- **A preview** is published by the pipeline's `deploy` job on every pull request, in the `staging` environment, with `id-token: write`. It runs `edge/publish.mjs preview`, which publishes the pull request's merge commit when its branch (`GITHUB_HEAD_REF`) is a `bb/**` branch, writes the URL to the job's `url` output, and skips everything else: other branches, and a pull request from a fork, which gets no OIDC token. A publish that fails (the route refuses it or can't be reached) writes `preview failed: <reason>` to the job summary and sets no URL, so the tests and reviews still run; none of them needs `STAGING_URL`. A push to a branch without a pull request publishes nothing. A newer push cancels the running CI, its publish included.
|
|
878
|
+
- **A preview** is published by the pipeline's `deploy` job on every pull request, in the `staging` environment, with `id-token: write`. It runs `edge/publish.mjs preview`, which publishes the pull request's merge commit when its branch (`GITHUB_HEAD_REF`) is a `bb/**` branch, writes the URL to the job's `url` output, and skips everything else: other branches, and a pull request from a fork, which gets no OIDC token. A publish that fails (the route refuses it or can't be reached) writes `preview failed: <reason>` to the job summary and sets no URL, so the tests and reviews still run; none of them needs `STAGING_URL`. Every skip also writes its reason to the job log, as a warning titled `preview`, and a token in the reason is printed as `***`. A push to a branch without a pull request publishes nothing. A newer push cancels the running CI, its publish included.
|
|
875
879
|
- **A preview** holds no secret: `ci.yml` sets no `deploy-secrets`, and the pipeline (from v2.12.0) passes the deploy job only the secrets that input names, so it gets none. `edge/publish.mjs` asks GitHub for the job's OIDC token (audience `https://sliccy.ai`) and publishes through the sliccy-ai worker's `/api/publish/*` route. The route checks the token's signature, issuer, audience, expiry, repository, the `staging` environment and the `refs/pull/<n>/merge` ref, then derives `branches/<label>/` from the token's `head_ref`. A branch can only ever write its own prefix, and never `seven/`. It first writes a manifest listing both the previous upload's files and this one's, so a publish cancelled midway leaves every file it uploaded on the list for the next publish to delete. Then files go up eight at a time, then deletions, then the final manifest.
|
|
876
880
|
|
|
877
881
|
## Rules
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-bios",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.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",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@ai-ecoverse/slicc": "1.69.4",
|
|
53
53
|
"@ai-ecoverse/slicc-browsers": "1.27.2",
|
|
54
|
-
"@ai-ecoverse/slicc-cdp": "1.
|
|
54
|
+
"@ai-ecoverse/slicc-cdp": "2.1.0",
|
|
55
55
|
"@ai-ecoverse/slicc-kernel": "1.191.2",
|
|
56
56
|
"@ai-ecoverse/slicc-shared-web": "2.16.0",
|
|
57
57
|
"@ai-ecoverse/slicc-spectrum": "2.19.4",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@ai-ecoverse/slicc-audio": "1.2.0",
|
|
10
10
|
"@ai-ecoverse/slicc-browsers": "1.27.2",
|
|
11
11
|
"@ai-ecoverse/slicc-capture": "1.5.0",
|
|
12
|
-
"@ai-ecoverse/slicc-devices": "1.
|
|
12
|
+
"@ai-ecoverse/slicc-devices": "1.6.0",
|
|
13
13
|
"@ai-ecoverse/slicc-kernel": "1.191.2",
|
|
14
14
|
"@ai-ecoverse/slicc-spectrum": "2.19.4",
|
|
15
15
|
"@ai-ecoverse/wasi-fnox": "1.48.0-1",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"node_modules/@ai-ecoverse/slicc-devices": {
|
|
65
|
-
"version": "1.
|
|
66
|
-
"resolved": "https://registry.npmjs.org/@ai-ecoverse/slicc-devices/-/slicc-devices-1.
|
|
67
|
-
"integrity": "sha512-
|
|
65
|
+
"version": "1.6.0",
|
|
66
|
+
"resolved": "https://registry.npmjs.org/@ai-ecoverse/slicc-devices/-/slicc-devices-1.6.0.tgz",
|
|
67
|
+
"integrity": "sha512-GdV5ZPNH8xvLWXIx7aaDMHewFzJTXyposYfkEJwut8U0RhfpkIv5WIqAD1eyeSOMq7UJy/L5JRn13j+YpG9GoA==",
|
|
68
68
|
"license": "Apache-2.0",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"esptool-js": "0.7.1"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"@ai-ecoverse/slicc-audio": "1.2.0",
|
|
7
7
|
"@ai-ecoverse/slicc-browsers": "1.27.2",
|
|
8
8
|
"@ai-ecoverse/slicc-capture": "1.5.0",
|
|
9
|
-
"@ai-ecoverse/slicc-devices": "1.
|
|
9
|
+
"@ai-ecoverse/slicc-devices": "1.6.0",
|
|
10
10
|
"@ai-ecoverse/slicc-kernel": "1.191.2",
|
|
11
11
|
"@ai-ecoverse/slicc-spectrum": "2.19.4",
|
|
12
12
|
"@ai-ecoverse/wasi-fnox": "1.48.0-1",
|
|
@@ -18,8 +18,8 @@ importers:
|
|
|
18
18
|
specifier: 1.5.0
|
|
19
19
|
version: 1.5.0
|
|
20
20
|
'@ai-ecoverse/slicc-devices':
|
|
21
|
-
specifier: 1.
|
|
22
|
-
version: 1.
|
|
21
|
+
specifier: 1.6.0
|
|
22
|
+
version: 1.6.0
|
|
23
23
|
'@ai-ecoverse/slicc-kernel':
|
|
24
24
|
specifier: 1.191.2
|
|
25
25
|
version: 1.191.2
|
|
@@ -61,8 +61,8 @@ packages:
|
|
|
61
61
|
engines: {node: '>=24', slicc-kernel: '>=1.153.0'}
|
|
62
62
|
hasBin: true
|
|
63
63
|
|
|
64
|
-
'@ai-ecoverse/slicc-devices@1.
|
|
65
|
-
resolution: {integrity: sha512-
|
|
64
|
+
'@ai-ecoverse/slicc-devices@1.6.0':
|
|
65
|
+
resolution: {integrity: sha512-GdV5ZPNH8xvLWXIx7aaDMHewFzJTXyposYfkEJwut8U0RhfpkIv5WIqAD1eyeSOMq7UJy/L5JRn13j+YpG9GoA==}
|
|
66
66
|
engines: {node: '>=24', slicc-kernel: '>=1.183.0'}
|
|
67
67
|
|
|
68
68
|
'@ai-ecoverse/slicc-kernel@1.191.2':
|
|
@@ -268,7 +268,7 @@ snapshots:
|
|
|
268
268
|
|
|
269
269
|
'@ai-ecoverse/slicc-capture@1.5.0': {}
|
|
270
270
|
|
|
271
|
-
'@ai-ecoverse/slicc-devices@1.
|
|
271
|
+
'@ai-ecoverse/slicc-devices@1.6.0':
|
|
272
272
|
dependencies:
|
|
273
273
|
esptool-js: 0.7.1
|
|
274
274
|
|