@ai-ecoverse/slicc-bios 1.59.2 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -398,12 +398,18 @@ Programs ask seven's page for what only a page can do through the kernel's `/dev
398
398
  - **Who answers:** the tab whose session started the process. The owner's `createKernel({ requests })` answers the page's own processes. Each tab's terminals attach with `attachKernel(port, { requests })` on a port the owner made with `connect({ requests: 'attach' })`. The agent's ports carry the owner page's hook (`kernel.connect({ tag, user, requests })`). A remote follower's shell, served by the leader, carries none, so its requests are `ENOTSUP` (`no page answers requests for this session`); they never open in the leader's browser.
399
399
  - **Gestures:** a request from a terminal tag (`{ kind: 'user', where: 'terminal:…' }`) in a tab that has just had a keystroke or click (`navigator.userActivation.isActive`) goes ahead at once. Any other request, the agent's always, waits for seven's own prompt: Cancel, or 60 s without an answer, refuses it with `EACCES`, and a signal or closed request withdraws the prompt. A session (its uid and tags) has at most one prompt up: another request from it meanwhile is refused with `EACCES`, `another request is waiting for you`. After a Cancel or a timeout the session rests for 10 s: its requests are refused with the dismissed text and no prompt, unless they come typed in an active tab. Withdrawing or timing out the prompt gives focus back to what had it.
400
400
  - **`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`.
401
- - **Tool modules** (capture, audio) export the kernel's hook object `{ kinds, handle }`. `plugged(hook, prompts, extra)` wraps one: only kinds seven lists and gives a prompt for reach it, and its `handle` runs only after seven's gesture check, with the request plus seven's `extra`. A module is a pinned, gated dependency in the base set, since it runs as seven.
402
- - **`capture.screen`** (`screencapture`, `@ai-ecoverse/slicc-capture/page`): the same gesture check as `open.url`, with the prompt "Capture the screen?". The prompt's action is Choose, and Chrome's picker comes next. The module captures only through seven's `request.display(constraints)`, which calls `getDisplayMedia` with `audio: false` unless a video request has `system: true` (`-A`), when it asks for `audio: true` and the prompt names "your screen and its sound"; Chrome's picker still lets the user decide whether to share sound. `selfBrowserSurface: 'exclude'`, `surfaceSwitching: 'exclude'` and `preferCurrentTab: false` always apply. A video request with `microphone: true` (`-g`) or a device ID (`-G`) also names the microphone in the same prompt, with "for up to N seconds" when `duration` is positive. It follows the same rule as `audio.record`: a command typed in an active tab can proceed, but the agent is always asked. Cancel opens neither device. Only after that check does seven supply a guarded `request.userMedia` for the default or exact named microphone, with no camera request. When the picked surface's capture handle is seven's or the vault's (`slicc-vault`; every seven page sets `setCaptureHandleConfig({ handle: 'slicc-seven', exposeOrigin: true })` for its own origin, first thing at boot), or its origin is protected, seven stops every track and refuses with `EACCES`, `seven doesn't capture its own pages or the vault`. For a tab, seven waits up to 1 s for a handle that arrives after the capture starts. A tab whose handle is still missing, or any surface Chrome doesn't name as a window or a screen, is refused too (`seven can't tell this tab isn't its own or the vault's (it sets no capture handle), so it doesn't capture it; share a window or the screen`): Chrome hides handles in off-the-record profiles, and an older vault sets none, so a missing handle can't prove the tab is safe. That costs every ordinary tab that sets no capture handle, which is most of them; share a window or the screen to capture one. A captured tab that navigates to a page without a handle is stopped the same way. Seven watches for handle changes from the moment the capture starts, so a change during that wait isn't lost. The same holds while the capture is live: when the captured tab's handle changes to seven's, a protected one or none (`capturehandlechange`), seven stops every track, ends the module's capture and refuses, even if a frame was already taken. A cross-origin navigation clears the handle first, so a tab that navigates to seven is usually refused with the missing-handle text. A window or a whole screen that shows seven, and a protected page that sets no capture handle, are the user's choice in the picker. The vault's top-level pages set `slicc-vault` for seven's production origins (slicc-vault ≥ 1.17.0), so they're refused too. A local seven gets no handle from vault-preview. A page that paints before it sets its capture handle can land in a frame taken in that moment, before seven sees the handle. The dismissed texts are `the request to capture the screen was dismissed` and `nobody answered the request to capture the screen within 60 s`.
401
+ - **Tool modules** (capture, audio) 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.
402
+ - **Capture** (`capture.screen`, `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:
403
+ 1. **The off switch** (`src/seed/switches.js`, `switches.add({ key, label, off() }) → { on() }`): Settings lists Camera, Microphone and Screen 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 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. Turning one off ends every live capture under it, in every tab, and a request still waiting for the agent, the prompt or its click is refused once the wait ends. Camera has nothing to guard yet.
404
+ 2. **Consent:** for `capture.screen` and `audio.record`, seven asks the agent with `approveCapture({ kind, options, stamp, label? }, { signal, where? })` (`label` is 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?" or "Use the microphone?", with Choose or Record and Cancel. Any other failure refuses with `the agent couldn't 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.
405
+ 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 microphone recording when the browser's microphone permission is `granted`. A state of `denied` refuses at once with `microphone permission is blocked for this site`. Otherwise a click in seven's tab can't be avoided (Chrome's picker always needs one, and so does the browser's own 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**, 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 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.
406
+ 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", "Taking a photo" (a screen 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 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`. The chip goes when the request ends, however it ends. Linked follower devices don't see it yet.
407
+ 5. **A listing of microphones** (`audio.record` with `devices`) gets the consent, but no switch, no click and no chip, since it doesn't open the microphone.
408
+ - **`capture.screen`** (`screencapture`, `@ai-ecoverse/slicc-capture/page`): the same gesture check as `open.url`, with the prompt "Capture the screen?". The prompt's action is Choose, and Chrome's picker comes next. The module captures only through seven's `request.display(constraints)`, which calls `getDisplayMedia` with `audio: false` unless a video request has `system: true` (`-A`), when it asks for `audio: true` and the prompt names "your screen and its sound"; Chrome's picker still lets the user decide whether to share sound. `selfBrowserSurface: 'exclude'`, `surfaceSwitching: 'exclude'` and `preferCurrentTab: false` always apply. A video request with `microphone: true` (`-g`) or a device ID (`-G`) also names the microphone in the same prompt, with "for up to N seconds" when `duration` is positive. It follows the same rule as `audio.record`. Cancel opens neither device. Only after that check does seven supply a guarded `request.userMedia` for the default or exact named microphone, with no camera request. When the picked surface's capture handle is seven's or the vault's (`slicc-vault`; every seven page sets `setCaptureHandleConfig({ handle: 'slicc-seven', exposeOrigin: true })` for its own origin, first thing at boot), or its origin is protected, seven stops every track and refuses with `EACCES`, `seven doesn't capture its own pages or the vault`. For a tab, seven waits up to 1 s for a handle that arrives after the capture starts. A tab whose handle is still missing, or any surface Chrome doesn't name as a window or a screen, is refused too (`seven can't tell this tab isn't its own or the vault's (it sets no capture handle), so it doesn't capture it; share a window or the screen`): Chrome hides handles in off-the-record profiles, and an older vault sets none, so a missing handle can't prove the tab is safe. That costs every ordinary tab that sets no capture handle, which is most of them; share a window or the screen to capture one. A captured tab that navigates to a page without a handle is stopped the same way. Seven watches for handle changes from the moment the capture starts, so a change during that wait isn't lost. The same holds while the capture is live: when the captured tab's handle changes to seven's, a protected one or none (`capturehandlechange`), seven stops every track, ends the module's capture and refuses, even if a frame was already taken. A cross-origin navigation clears the handle first, so a tab that navigates to seven is usually refused with the missing-handle text. A window or a whole screen that shows seven, and a protected page that sets no capture handle, are the user's choice in the picker. The vault's top-level pages set `slicc-vault` for seven's production origins (slicc-vault ≥ 1.17.0), so they're refused too. A local seven gets no handle from vault-preview. A page that paints before it sets its capture handle can land in a frame taken in that moment, before seven sees the handle. The dismissed texts are `the request to capture the screen was dismissed` and `nobody answered the request to capture the screen within 60 s`.
403
409
  - **`clipboard.write`** (`{"kind":"clipboard.write","type":"image/png"}`, the bytes as the body, an empty reply; `screencapture -c`): `src/seed/clipboard.js` writes one `ClipboardItem` of `image/png`, `text/plain` or `text/html`, with `/dev/clipboard`'s focus rule and refusal text. Other types are `ENOTSUP`. The body is read up to 16 MB; beyond that seven cancels the rest and fails with `EIO`, `seven copies at most 16 MB to the clipboard`.
404
410
  - **Audio** (`afplay`, `chime`, `say`, `hear`, `@ai-ecoverse/slicc-audio/page`; kinds `audio.play`, `audio.say`, `audio.voices`, `audio.record`, `audio.transcribe`):
405
411
  - **Sound and speech:** `audio.play` ("Play a sound?") and `audio.say` ("Speak aloud?") get the same gesture check as `open.url`.
406
- - **The microphone:** `audio.record`, and every `audio.transcribe` except a probe or a `whisper` one that sends its own audio, ask "Use the microphone?" on every request, unless the request comes typed in an active tab. When the request carries a positive `seconds`, the prompt says how long ("…record from your microphone for up to 5 seconds"). The agent is always asked. The browser's microphone permission lasts per origin after the first grant, so it isn't the gate; seven's prompt is. Cancel leaves the microphone unopened.
412
+ - **The microphone:** `audio.record`, and every `audio.transcribe` except a probe or a `whisper` one that sends its own audio, ask "Use the microphone?" on every request, unless the request comes typed in an active tab; for `audio.record` that prompt is the fallback of the capture steps above. When the request carries a positive `seconds`, the prompt says how long ("…record from your microphone for up to 5 seconds"). Cancel leaves the microphone unopened.
407
413
  - **No prompt:** `audio.voices`; `audio.say` status and warm-up; `audio.transcribe` status, warm-up and supported-language probes; and a `whisper` transcribe of bytes the program sends. Listing microphones (`audio.record` with `devices`) asks like any recording. For `whisper`, seven reads the start of the request's body to see whether it carries audio. Web Speech (`webspeech`) always listens to the microphone and ignores any bytes, so it's always asked, and so is an unknown or missing engine.
408
414
  - **Stopping:** an abort (a signal, or the program closing the request) stops a recording at once.
409
415
  - **ortllama:** slicc-audio's optional `@ai-ecoverse/slicc-ortllama` isn't in the base set, because the BIOS installer skips lock entries marked `optional` and the in-place base update runs `pnpm install --no-optional`. So `afplay`, `chime` and the Web Speech engines work. The kokoro and whisper engines fail with `no server at http://11435.kernel.localhost (pnpm add -g @ai-ecoverse/slicc-ortllama, then ortllama serve --detach)` until an ortllama server runs in the kernel.
@@ -476,6 +482,8 @@ A program picks a host by adding `runtime=extension`, `runtime=devtools`, or a l
476
482
 
477
483
  **No consent dialog.** A connection goes straight through once the hook has found a host; seven doesn't ask first. The once-per-session confirm from #138 was removed by Lars's decision W10. The Network panel shows the host in its browser automation line (`browser` on the network port, from `browserVia`): through the extension, through this browser's DevTools port (`devtools`), through a linked browser, or not available.
478
484
 
485
+ **Linked devices drive it too (`slicc <join-url> cdp`).** A linked slicc CLI can serve seven's browser as a local CDP endpoint on its own computer (see [Linked devices](#tailscale-proof-of-concept), *Browser control*). Each of its connections reaches the same `cdp` hook as a kernel program's, so it goes through the same guard: seven's own pages and the vault stay out of reach, and the guard's `slicc.route` hint names the host it picked. The hook takes `caller: { kind: 'device', id, name }` and hands it to its `observe` callback; seven's observer doesn't use it today, and the chip takes the device's name from the link. The caller changes nothing in routing, but the device asks with `here: true`: the automatic order stops at the browser seven runs in (the extension, the DevTools port, or a `seven: true` browser from a CLI on this computer) and never falls back to another linked computer's browser. A kernel program's automatic runtime is unchanged.
486
+
479
487
  When no host can drive a browser, `/json/list` and the WebSocket handshake answer `502` with `CDP host: no browser to drive: install slicc-extension, or link a computer with npx sliccy@next`. A runtime that isn't `extension`, `devtools` or a linked browser gets `CDP host: unknown runtime "<name>" (extension, devtools, …)`, listing the linked browsers. `/json/version` answers either way, since a hook is always offered.
480
488
 
481
489
  ### Tailscale (proof of concept)
@@ -523,6 +531,12 @@ seven can also join a tailnet, with a patched build of Tailscale's wasm client (
523
531
  - **Body:** it is passed on as text: JSON as the hub parsed it, or the original text when it wasn't JSON. A `{"raw": …}` body from a JSON request stays JSON.
524
532
  - **Retries:** an `idempotency-key` or `x-github-delivery` header becomes the delivery id, so a retry isn't delivered twice.
525
533
  - **No agent:** with no agent running, or a slicc-agent without page-side webhooks, the delivery is dropped with a warning. The hub has already answered the sender `202`.
534
+ - **Browser control (`cdp-in`):** the page's HELLO to every CLI link, local and remote, offers `cdp-in` when seven can serve the kind; a seven follower's HELLO doesn't. It says the page understands the kind, not that the device may use it. The CLI opens `OPEN { kind: 'cdp' }` on a channel of its own (an even, node-opened id, so it never meets the page-opened `cdp` of shared browsers), and the page checks, on every OPEN and in this order:
535
+ 1. **The off switch** *Browser control from linked devices* (`remote-browser` on the `switches` port), on by default because each device's grant is off by default. Off refuses with `EACCES: browser control from linked devices is off in seven's settings`, and turning it off resets every open `cdp` stream with that text.
536
+ 2. **The device's Browser grant:** the `browser` access in Linked devices (`setAccess(id, 'browser', on)`), off by default, kept per device certificate in `slicc-os.devices` and cleared by unlinking it, like Control. It doesn't turn View on. A CLI on this computer that isn't paired has it fixed on (`access: { control: true, browser: true, fixed: true }`), a remote CLI's row shows `access: { control, browser }`, a paired one follows its own access, and seven followers have no `browser` key. Without it: `EACCES: browser control from this device is off; turn on Browser for it in seven's Linked devices`. Turning it off, or unlinking the device, resets the device's streams with `EACCES: the owner took this access back`. Any link that isn't a CLI gets `EACCES`, and a device with 16 `cdp` streams open gets `EMFILE: too many browser connections from this device` for the next.
537
+ 3. **This browser:** the page calls `browserControl().hook({ caller, here: true })`, the kernel's own hook (see [Browser automation](#browser-automation)). `here` limits it to the browser seven runs in: slicc-extension, the browser's DevTools port, or a browser that hosts this seven (`seven: true`) shared by a CLI on this computer, and never another linked computer's browser, which kernel programs can still reach. `seven: true` is what the CLI claims, so a remote link's claim doesn't count here. Its failure is `ENOENT: <its message>`, for example `ENOENT: no browser to drive: install slicc-extension, or link a computer with npx sliccy@next`.
538
+
539
+ The page then sends `Browser.getVersion` on the guarded connection as id `-2`, answers OPENED `{ version }` with its result (and the guard's `slicc.route` hint), and keeps that one answer off the stream. After OPENED nothing is held back: a client's own command with id `-2` and its answer pass both ways. Both directions carry `u32` big-endian length plus one UTF-8 CDP JSON message of at most 64 MiB, passed as they are: no ids or sessions are rewritten. A longer message is `EMSGSIZE`, and an END inside one is `EPROTO`. Bytes from the node are credited as the page reads each chunk, so a message can be larger than the window; toward the node, messages wait while the window is full, up to 64 MiB per stream, then `ENOBUFS`. The node's END closes the connection, then the page ends the stream; the connection closing on its own is `ECONNRESET: <reason>`, and an unlink or a dropped link ends the streams with the link. While a device has a `cdp` stream open, the `live` port shows one item for it, `{ kind: 'cdp', label: 'Driving this browser', asker: <its name as Linked devices shows it, without control characters and at most 128 characters> }`, with **Stop**, which resets that device's streams with `ECONNRESET: stopped in seven`. Stop, the switch going off and the grant being revoked (or the device unlinked) take the item away at once, also while it only lingers, and a stream the device opens after that shows a new one. When the device's last stream ends on its own (its END, or the connection closing), the item stays 5 s, so discovery's short streams don't make it flicker.
526
540
  - **Remote control (`agent`):** a linked CLI can prompt, watch and stop seven's agent (`slicc prompt`, `slicc watch`, `slicc abort`). The page offers cap `agent` to a CLI on this computer always, and to a remote device only after **Control** is turned on for it in Linked devices. That setting is kept per device certificate and cleared by unlinking it. Any other link's agent OPEN gets `EACCES`.
527
541
  - 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 }`.
528
542
  - `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**.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.59.2",
3
+ "version": "1.61.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",