@ai-ecoverse/slicc-bios 2.4.3 → 2.5.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
@@ -182,9 +182,10 @@ The kernel runs with users on (slicc-kernel ≥ 1.81.0): files have owners and m
182
182
  - **A remembered mount** (`slicc-os.mounts`) at, under or above a protected path is dropped at boot under `'enforce'`, with a notice, *A remembered folder wasn’t mounted*.
183
183
  - **Sudo approvals through the agent** (slicc-agent ≥ 7.17.0, slicc-kernel ≥ 1.174.0, spectrum ≥ 1.112.0): bios only routes. While the agent runs, the kernel's `approve` hook hands each request to the agent's `owner.approve(req, { signal, where })` unchanged, the kernel's facts included: `always` (`false` when the line can't be recorded as a rule), `stdin` (`tty`, `none`, `pipe` or `file`) and `rootOnly` (for the directory and each path on the line, whether only root can change it). bios returns the agent's answer as it is. It becomes a `sudo` item in the agent's approvals, which every owner device answers with the same powers: this tab, other tabs, and linked followers with or without Control. The judge is slicc-agent's: it gives each request a level and a reason, and offers *Always allow* only to a person, at level 1, when its model says a later run of the same line can do no more. Enforcement and rule recording are the kernel's: it writes an *Always* as the exact line with `Stdin none`, and runs an *Always* for a line it can't record once. bios checks no command text. A request from a follower's shell names that device (`where`, "on <device>"), and each linked device's agent port is opened with `owner.port({ device })`, so the item records which device answered. The tab hands its own approvals port to `createAgentModel(connection, { approvals })`, so `model.approvals` lists both sets. When the agent can't take a request (it rejects with `EAGAIN`: released, restarting or an older worker), isn't running, or was started from a release older than 7.17.0 (one without the judge, which can still run until it restarts after an update), bios's own dialog below asks instead.
184
184
  - **Sudo approvals in bios's dialog:** without the agent there is no judge, so the kernel's `approve` hook feeds `model.approvals`, spectrum's sudo dialog, with *Allow once* and *Deny* only and no verdict. It shows the resolved path and arguments, shell-quoted, the directory, the requester mapped from the tag and the target. Every tab shows the request (`BroadcastChannel('slicc-approvals')`), and the first decision wins; the other tabs see *Answered in another tab*. The item has `always: false`, and an `always` decision for it, from any tab, is refused with *Always isn't offered for this request.* and the request stays open, so no `NOPASSWD` line is written from bios's dialog.
185
- - **Approvals panel and Run now** (spectrum ≥ 2.14.1, slicc-kernel ≥ 1.181.0, protocol 1.16; notices need slicc-agent ≥ 7.34.0): bios's ApprovalsPort keeps `history()` (pending and settled records, newest first) and emits `history` when any record changes, so spectrum offers the Approvals panel (`data-surface="approvals"`, right, closed by default). A timed-out sudo stays `unanswered` with `reason: 'timeout'`. **Run now** (`run(id)`) is only for those records: bios calls the kernel's `sudoRun` with the original request so the kernel re-checks policy, command hash and cwd at run time; bios never runs the command itself. `stopRun(id)` signals the run's process group while it is `running`. After a run actually starts, bios sends start and end facts through the owner-device control method `connectAgent().approvalRunNotice(notice)` (feature-detected; older agents log one warning and keep a debug buffer). The agent renders the `sudo-run` lick (`bios:<id>:start` / `:end`); a kernel refusal that runs nothing sends no notice.
185
+ - **Approvals panel and Run now** (spectrum ≥ 2.14.1, slicc-kernel ≥ 1.181.0, protocol 1.16; notices need slicc-agent ≥ 7.34.0): bios's ApprovalsPort keeps `history()` (pending and settled records, newest first) and emits `history` when any record changes, so spectrum offers the Approvals panel (`data-surface="approvals"`, right, closed by default). A timed-out sudo stays `unanswered` with `reason: 'timeout'`. **Run now** (`run(id)`) is only for those records: bios calls the kernel's `sudoRun` with the original request so the kernel re-checks policy, command hash and cwd at run time; bios never runs the command itself. `stopRun(id)` signals the run's process group while it is `running`, and its survivors after that (below). After a run actually starts, bios sends start and end facts through the owner-device control method `connectAgent().approvalRunNotice(notice)` (feature-detected; older agents log one warning and keep a debug buffer). The agent renders the `sudo-run` lick (`bios:<id>:start` / `:end`); a kernel refusal that runs nothing sends no notice.
186
186
  - **Who records:** ownership follows who held the ask. While the agent is up and `owner.approve` resolves (no `EAGAIN`), the item lives in the agent's approvals (`apr-…`); bios's `history()` has no row and stores no replay. bios records only asks its own dialog answered or that timed out there (agent down, released, restarting, an `EAGAIN` fallback, or no judge). History ids are `bios:<kernel id>`, so they stay disjoint from the agent's `apr-…` when the spectrum adapter merges both ports and routes `run`/`stopRun` by id. The notice `id` is that same `bios:<kernel id>`; the agent appends `:start` / `:end` when it renders the `sudo-run` lick, never using an `apr-…` id for a bios-held run.
187
187
  - **`runnable`:** `true` only for an unanswered (timed-out) agent sudo that has no run yet, on a kernel that supports `sudoRun` (protocol ≥ 1.16), and when the stored replay still has what `sudoRun` needs (`rootOnly`, absolute `path`/`cwd`, no `validate`, stdin not `pipe`/`file`, within the late-run age). Otherwise `{ reason }` (for example "Run it again in the terminal.", "Needs slicc-kernel protocol 1.16 or later.", "Its input is gone, so it must be asked again."). Spectrum trusts `runnable`: the panel enables Run now only for `true`.
188
+ - **Survivors** (spectrum ≥ 2.15.0): when a run's leader exits, is stopped or fails, bios looks up the processes still carrying its `sudo-run:<id>` tag as the target user, through a kernel client's `ps()`, leader excluded. If any are left, they're the run's `survivors` (pids), and the end notice carries them. The panel then shows *Still running: pid …* with **Stop**. bios checks the list once a second and drops `survivors` once those processes are gone. `stopRun` on a `done`, `stopped` or `failed` run with survivors sends `SIGTERM` to exactly the listed pids that still carry the tag, as the target user, never pid 1 or lower. The kernel has no kill by tag, so right before each kill bios reads the process list again. It skips a pid that no longer carries the tag as that user, or whose start time or process group changed, as when the process exited and another took its pid. A failed kill is reported only while one of them is still there.
188
189
  - **Another tab takes over:** the owner's `history` broadcast carries the replay it stored for each record, and every other tab keeps it, dropping a replay whose command, directory, target or user differs from its record's. So when the owner tab closes, a timed-out row stays runnable in the tab that takes over. The kernel runs in the owner tab, so that tab starts a new one. Each record the closed tab had `starting` or `running` is looked up by its `sudo-run:<id>` tag, through a kernel client's `ps()` on that kernel, among the target user's processes, once a second until the process list answers. A run that's found is re-attached: `stopRun` signals its process group, and the row ends (`done`, its exit status unknown) when its leader exits. One that's gone ends at once: `done` with its exit status unknown and an end notice, or `failed` (*The tab that started it closed before it ran.*) if it hadn't started. Until the new kernel's process list answers, `stopRun` refuses with *The kernel's process list isn't available, so it can't be stopped.*
189
190
  - **Sudo timestamps** (slicc-kernel ≥ 1.177.0): as in sudo(8), a person's approval lets the same place run `sudo` again without asking for a few minutes. Seven keeps the kernel's defaults, 5 minutes (`timestamp_timeout`) per terminal (`timestamp_type=tty`), so several `sudo` lines typed in one terminal share the window, and seeds no `Defaults` line; an admin can write one in `/etc/sudoers.d` as root. An agent's bash call has no terminal, so it falls back to `ppid` and each call asks again. Only a person's approval opens the window:
190
191
  - **Through the agent** (slicc-agent ≥ 7.27.0), a person's *Allow once* or *Always allow* answers `{ answer, timestamp: true }` and the judge's approval a plain `once`; bios passes the kernel's request, `timestamp` and `validate` included, and the agent's answer through unchanged.
@@ -435,6 +436,51 @@ Seven keeps its secrets in the vault, a separate origin (`@ai-ecoverse/slicc-vau
435
436
  - **Egress:** token refreshes use the same selected transport with a manual redirect policy, never a native-fetch fallback. An incapable route or redirect is refused; the response returns only to the vault. A `GET` or `HEAD` (GitHub Copilot's token exchange) goes out without a body. Request bodies are zeroed after use, and requests are not logged.
436
437
  - **Adobe IMS:** with agent ≥ 4.0.0, `login('adobe', …)` opens its popup before anything else, then seals the token as `{ kind: 'model', provider: 'adobe', name: 'ADOBE_IMS_TOKEN', source: 'oauth:adobe', expiresAt }` (the redirect's `expires_in` is in seconds, 86399 for a day) and resolves `{ sealed: true }`, so the token never reaches spectrum or the agent. IMS gives no refresh token: an expired token means signing in again, which replaces the record and keeps its placeholder. Agents before 4.0.0 get the token as before.
437
438
 
439
+ ## Devices
440
+
441
+ Seven can talk to hardware you plug in or pair: serial ports (Arduino, ESP32, routers), USB devices, HID devices (vendor keyboards, sensors, macro pads) and Bluetooth Low Energy devices. It works in Chromium-based desktop browsers (Chrome, Edge, Opera); Firefox, Safari and every browser on iOS answer `ENOTSUP` for these commands. You and your agents use the same commands, and nothing needs setting up: the groups and switches below are in place from the first boot. How each kind is wired, with its kinds, policies and exact messages, is under [Requests from programs](#requests-from-programs-devembedder), and every command's flags are in [slicc-devices' README](https://github.com/ai-ecoverse/slicc-devices#readme).
442
+
443
+ ### What each device kind does
444
+
445
+ - **Serial** (`serial`, and the device files `/dev/ttyUSB*` and `/dev/ttyACM*`): talk to a board or modem: `serial request`, `serial open serial1 --baud 115200`, `serial read`, `serial write`, `serial console`. Programs such as `cat`, `stty`, `screen`, `picocom` and Python's pyserial use the same port through its device file.
446
+ - **ESP flashing** (`esptool`): read chip info from ESP32 and ESP8266 boards and flash them.
447
+ - **USB** (`usb`): raw USB: `usb request`, `usb open`, `usb claim`, bulk and interrupt transfers (`usb transfer-in`, `usb transfer-out`) and control transfers (`usb control-in`, `usb control-out`). Chrome keeps its protected interface classes, such as HID and audio, to itself.
448
+ - **HID** (`hid`): vendor-defined HID devices: `hid request`, `hid watch` (input reports), `hid send` (output reports), `hid query`, and feature reports (`hid feature-send`, `hid feature-get`). Chrome refuses keyboards, mice and its other protected usages.
449
+ - **Bluetooth LE** (`ble`): seven is a GATT client: `ble request --service heart_rate`, `ble services`, `ble read`, `ble notify`, `ble write`. There is no scanning, no peripheral role and no Bluetooth Classic, and after a page reload a device may have to be chosen again.
450
+
451
+ ### Choosing a device
452
+
453
+ The only prompt is the browser's own device chooser. When you type `serial request` (or `usb request`, `hid request`, `ble request`) in a seven terminal, the chooser opens right away. When an agent or a script asks, seven shows "Choose a serial port" (or a USB, HID or Bluetooth device), and the chooser opens when you click **Choose…**. Cancel, or no click within 5 minutes, refuses the request. While seven's tab is in the background, its title starts with `● `. Once a device is chosen, using it asks nothing more: the groups below decide the rest.
454
+
455
+ ### Groups and sudo
456
+
457
+ Devices follow the Linux rule: members of the device's group read, and writing needs root, which for an agent means `sudo`.
458
+ - **`dialout`** (serial ports and their device files): members list, choose, open, read, read the modem lines and close a port, and open its device file for reading (`stty -F` included). `sudo` is needed to write, to set DTR, RTS or break, to open the device file for writing (as `screen`, `picocom` and pyserial do) and for `esptool`.
459
+ - **`plugdev`** (USB and HID): members list, choose, open and close a device, claim and release a USB interface, and read (`usb transfer-in`, `hid watch`). `sudo` is needed for anything sent to a device: `usb transfer-out`, `usb control-in`, `usb control-out`, `usb select-config`, `usb reset`, `usb clear-halt`, `hid send`, `hid query`, `hid feature-send` and `hid feature-get`.
460
+ - **`bluetooth`** (Bluetooth LE): members list, choose, connect, disconnect, read services and values, and follow notifications. `sudo` is needed for `ble write`.
461
+
462
+ Your own terminals are root. Agents, the cone and its scoops, are in all three groups, so they can look and read by default. To write, an agent runs `sudo usb transfer-out …` (and so on), and sudo's judge decides, as for any other command. Scoops have no `sudo`, so they read and can't write.
463
+
464
+ A USB claim belongs to whoever made it, even across `sudo`: when an agent claims an interface and then runs `sudo usb transfer-out`, the transfer is that agent's. Two agents can't hold the same interface at once; the second is told who holds it, and `usb claim --wait` queues for it.
465
+
466
+ ### Settings switches and the chip
467
+
468
+ Seven's Settings has one switch per kind, next to Camera, Microphone and Screen: **Serial ports**, **USB devices**, **HID devices** and **Bluetooth devices**, all on by default. Turning one off refuses every command of that kind (`USB devices are off in seven's settings`, and so on), closes whatever is open (a serial port is hung up, a USB or HID device closed, a Bluetooth device disconnected, a running `esptool` stopped), and ends reads, watches and notifications that were running.
469
+
470
+ While a device is open, the live list shows a chip such as "Serial port open" with `serial1`, "USB device open" with `usb1 (0x2341:0x0043 Arduino Uno)`, "HID device open" or "Bluetooth device connected" with `ble1 (Polar H10)`, with who is using it (the cone, a terminal or a program) and for how long. **Close** on the chip closes the device at once: a running read ends, and later requests fail with an error that says it was closed in seven.
471
+
472
+ ### Errors you may see
473
+
474
+ - **`EACCES`:** you aren't in the device's group, the command writes and needs `sudo`, the chooser was cancelled or nobody clicked, the switch is off, or Chrome refused a protected device or service.
475
+ - **`EBUSY`:** a USB or HID device is open in another tab or program, a USB interface is claimed by someone else, a serial port is in use by `esptool` or held by its device file and the `serial` command at once, or a Bluetooth characteristic already has a notifier.
476
+ - **`ENOTSUP`:** this browser has no Web Serial, WebUSB, WebHID or Web Bluetooth, or the Bluetooth adapter is off.
477
+ - **`ENOENT`:** the handle (`serial9`, `usb9`, …) isn't one this tab knows.
478
+ - **`EIO`:** the device went away, it was closed in seven, a serial port is open in another tab or program, or the browser reported a transfer error, whose message is the browser's own.
479
+
480
+ ### What is not included
481
+
482
+ Device files for USB (`/dev/bus/usb`, so libusb) and HID (`/dev/hidraw*`) and for Bluetooth, Bluetooth scanning and Bluetooth Classic, MIDI, and using a linked machine's devices from seven.
483
+
438
484
  ## Requests from programs (`/dev/embedder`)
439
485
 
440
486
  Programs ask seven's page for what only a page can do through the kernel's `/dev/embedder` (slicc-kernel ≥ 1.153.0, #1527). `src/seed/requests.js`'s `pageRequests()` is the one hook seven gives the kernel. Seven owns the list of kinds and their policies (`KINDS`), and every answer goes through the checks seven owns, whoever wrote the handler.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "2.4.3",
3
+ "version": "2.5.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",
@@ -53,9 +53,9 @@
53
53
  "@ai-ecoverse/slicc-browsers": "1.27.3",
54
54
  "@ai-ecoverse/slicc-cdp": "2.1.0",
55
55
  "@ai-ecoverse/slicc-kernel": "1.191.2",
56
- "@ai-ecoverse/slicc-shared-web": "2.16.0",
56
+ "@ai-ecoverse/slicc-shared-web": "2.16.1",
57
57
  "@ai-ecoverse/slicc-spectrum": "2.19.4",
58
- "@ai-ecoverse/slicc-vault": "1.29.1",
58
+ "@ai-ecoverse/slicc-vault": "1.29.2",
59
59
  "@biomejs/biome": "2.6.7",
60
60
  "aws4fetch": "1.0.20",
61
61
  "es-module-lexer": "3.0.4",
@@ -9,7 +9,7 @@
9
9
  "@ai-ecoverse/slicc-audio": "1.2.0",
10
10
  "@ai-ecoverse/slicc-browsers": "1.27.3",
11
11
  "@ai-ecoverse/slicc-capture": "1.5.0",
12
- "@ai-ecoverse/slicc-devices": "1.6.1",
12
+ "@ai-ecoverse/slicc-devices": "1.6.2",
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.6.1",
66
- "resolved": "https://registry.npmjs.org/@ai-ecoverse/slicc-devices/-/slicc-devices-1.6.1.tgz",
67
- "integrity": "sha512-irhPBRHsvqxbaCddkWq9KBpWnvIUZ0vjfYdBnxTRHG9Y3H8D4YqFl45a787cuQAMk+cjlRt8t/Edg3DNm9Hmpg==",
65
+ "version": "1.6.2",
66
+ "resolved": "https://registry.npmjs.org/@ai-ecoverse/slicc-devices/-/slicc-devices-1.6.2.tgz",
67
+ "integrity": "sha512-OWckpdk+zVelZJxlNGMRi72yB5hsAOosQWiLPCO1KQFLSNoM4h6DmGg8O4TalmQO9KYHt19B/TmGJoNCYRQs8g==",
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.3",
8
8
  "@ai-ecoverse/slicc-capture": "1.5.0",
9
- "@ai-ecoverse/slicc-devices": "1.6.1",
9
+ "@ai-ecoverse/slicc-devices": "1.6.2",
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.6.1
22
- version: 1.6.1
21
+ specifier: 1.6.2
22
+ version: 1.6.2
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.6.1':
65
- resolution: {integrity: sha512-irhPBRHsvqxbaCddkWq9KBpWnvIUZ0vjfYdBnxTRHG9Y3H8D4YqFl45a787cuQAMk+cjlRt8t/Edg3DNm9Hmpg==}
64
+ '@ai-ecoverse/slicc-devices@1.6.2':
65
+ resolution: {integrity: sha512-OWckpdk+zVelZJxlNGMRi72yB5hsAOosQWiLPCO1KQFLSNoM4h6DmGg8O4TalmQO9KYHt19B/TmGJoNCYRQs8g==}
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.6.1':
271
+ '@ai-ecoverse/slicc-devices@1.6.2':
272
272
  dependencies:
273
273
  esptool-js: 0.7.1
274
274