@ai-ecoverse/slicc-bios 1.12.1 → 1.13.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 +6 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -380,10 +380,12 @@ seven can also join a tailnet, with a patched build of Tailscale's wasm client (
380
380
  - **Who may:** only under kernel users `enforce`, and only root and members of `sudo` (cones), as the kernel's stamp on the connection says. A scoop gets `EACCES` and a `connect` denial in `denials.log`; under `off` and `report` everyone gets `EACCES`.
381
381
  - **The facade:** one connection per stream, in records of a `u8` type (`1` control, `2` data, `3` end), a `u32` length and the payload. The first record is `{ v: 1, join, open }`, and the page answers `{ opened }` or `{ reset: 'ERRNO: message' }`. Only `kind: 'agent'` with `prompt`, `watch` or `abort` opens, with only the fields those take. A long prompt (`length`) is answered at once, read whole, and sent on with the length of what it became. After that, only a `reset` may come as control, and it passes on just its errno.
382
382
  - **Secrets:** while the vault holds values, every outgoing prompt passes its scrubber (`redact`, on an agent-role port of the page's own), so a value leaves as its placeholder. While the scrubber is locked, the answer is `EACCES: unlock the vault to continue`.
383
- - **The link:** the page attaches as runtime `slicc-link/1`, so the other seven treats it as a CLI: it needs **Allow remote control** for this device in its Linked devices, or the answer is `EACCES` with that hint (and the link is closed, so the next run sees a fresh HELLO). The page's HELLO has `caps: []` and a fresh `node`, it opens only `agent` streams, and it refuses every stream the other seven opens with `EACCES`. There is one link per join URL, dialled on demand (45 s per dial, with retries after 1, 2 and 5 s), kept while a stream uses it and closed 10 minutes after the last one ends.
384
- - **Identity and state:** one certificate per hub origin in the IndexedDB database `slicc-follow`, under `link:<hub>`, apart from a follower tab's own. `localStorage` (`slicc-os.leaders`, the newest 16) keys each join URL's state by its SHA-256 and keeps only a moved tray's new URL. The join URL itself is never stored, logged or put in an error. Every seven on the hub sees that one certificate, as it sees a CLI's (§1.4), so they are the owner's devices recognising one device. An `UNLINKED` refusal drops only that leader's record and marks it unlinked: the certificate stays, so the other sevens on the hub keep recognising this one and keep their **Allow remote control**. The next run to the leader that unlinked it, the re-link its message asks for, mints a new hub certificate once, even if it fails and is run again, and that is the one action that makes every seven on the hub see a new device.
385
- - **Refusals:** a join URL on a hub seven doesn't link through, a forged or expired one, and an unlink are `EACCES`, so `slicc` exits 3 with the reason. A tray that can't be reached in time is `ENOTCONN`, which `watch` retries.
386
- - **Tests:** `test/integration/follow-slicc.test.mjs` runs the real `slicc` from the catalog as a cone in seven's terminal against a second seven's real agent over a fake tray hub: refused until Allow remote control, then prompt, watch and abort; a vault value scrubbed on the way out; a forged URL, another hub, a scoop and an unlinked device refused; and a fake leader whose `unlink`, `join`, `agent` and `kernel` OPENs are refused while it is followed. `test/integration/leaders.test.mjs` has a fake leader unlink this seven while a real one keeps recognising it after a reload, with its grant, until the re-link makes a new device. Re-links that fail while that leader doesn't answer mint that new certificate once, not once per retry.
383
+ - **The link:** the page attaches as runtime `slicc-link/1`, so the other seven treats it as a CLI: it needs **Allow remote control** for this device in its Linked devices. The other seven decides that on every stream, so a grant counts on the next run without a new link, and its `EACCES` reaches `slicc` with that hint. The page's HELLO has `caps: []` and a fresh `node`, it opens only `agent` streams, and it refuses every stream the other seven opens with `EACCES`.
384
+ - **Following:** there is one link per join URL. The first run dials it (45 s, with retries after 1, 2 and 5 s while it waits). From then on, the owner tab follows that seven: it keeps the link up, dials it again when it drops, with a backoff of 1, 2, 5, 10, 30 and then 60 s, and dials every kept leader again when seven boots. While nothing waits on it, a dial asks the hub once and backs off when that seven isn't on its tray, instead of polling. A tab hidden for 10 minutes stops dialling until it's shown or a run needs the link.
385
+ - **Identity and state:** one certificate per hub origin in the IndexedDB database `slicc-follow`, under `link:<hub>`, apart from a follower tab's own. `localStorage` (`slicc-os.leaders`, the newest 16) keys each leader's record by the SHA-256 of its join URL. The record keeps the hub, the join URL (or a moved tray's new one, so seven can dial it again after a reload), the name from its HELLO and whether it's disconnected. The join URL is a credential: it stays in that record, goes only to its own hub, and is never logged, put in an error or shown. Every seven on the hub sees that one certificate, as it sees a CLI's (§1.4), so they are the owner's devices recognising one device. An `UNLINKED` refusal drops only that leader's record and marks it unlinked: the certificate stays, so the other sevens on the hub keep recognising this one and keep their **Allow remote control**. The next run to the leader that unlinked it, the re-link its message asks for, mints a new hub certificate once, even if it fails and is run again, and that is the one action that makes every seven on the hub see a new device.
386
+ - **Refusals:** a join URL on a hub seven doesn't link through, a forged or expired one, a disconnected leader and an unlink are `EACCES`, so `slicc` exits 3 with the reason. An unlink the owner tab finds while nothing waits is told to the next run, and only the run after that re-links. A tray that can't be reached in time is `ENOTCONN`, which `watch` retries.
387
+ - **Leaders in the Network panel:** `status().leaders` lists each kept leader by its join key (`id`), its name (`slicc` shown as `SLICC`, with the start of the key when two share a name), its hub's host and its state: `connecting`, `connected`, `reconnecting`, `failed` with the reason (a forged or expired join URL, or a tray that moved to another hub), `disconnected`, or `unlinked` once, in the status that reports it. The status never carries a join URL. **Retry** dials a failed leader again. **Disconnect** closes the link and keeps the record and the certificate: the leader stays disconnected across reloads, seven never dials it, and `slicc` to it is refused until **Reconnect**, which dials it with the same certificate. **Forget** drops the record, join URL included, and leaves only the re-link mark: the hub's certificate stays, so the other sevens on the hub keep their grants, and the next run to it mints the new one, as after an unlink. Other tabs act on them through the owner tab.
388
+ - **Tests:** `test/integration/follow-slicc.test.mjs` runs the real `slicc` from the catalog as a cone in seven's terminal against a second seven's real agent over a fake tray hub: refused until Allow remote control, then prompt, watch and abort; a vault value scrubbed on the way out; a forged URL, another hub, a scoop and an unlinked device refused; and a fake leader whose `unlink`, `join`, `agent` and `kernel` OPENs are refused while it is followed. `test/integration/leaders.test.mjs` has a fake leader unlink this seven while a real one keeps recognising it after a reload, with its grant, until the re-link makes a new device. Re-links that fail while that leader doesn't answer mint that new certificate once, not once per retry. `test/integration/follow-leaders.test.mjs` drives the Leaders section against a real seven and a fake one on one hub: both connected, Disconnect holding across a reload with no dial while the other is dialled again at boot, Reconnect with the same certificate, an expired tray failing with Retry, and Forget, after which the join URL is nowhere in `localStorage`, IndexedDB or OPFS, the real seven keeps its grant, and the next run to the fake one is a new device.
387
389
  - **The tray:** its capabilities are kept in `localStorage` (`slicc-os.tray`), so the join URL survives reloads. A hub that forgot the tray gets a new one. The leader socket pings every 30 s and reconnects with backoff. Elsewhere (`localhost`, tests) the tray starts only when `localStorage['slicc-os.tray-hub']` names a hub.
388
390
  - **Kernel side:** the kernel gets one uplink and one route table, the union of what the active exits offer, pushed with `kernel.setRoutes`.
389
391
  - **Choosing an exit:** for each destination, an exit that claims it (a tailnet address or MagicDNS name) wins. Otherwise the default exit takes it: the one that offers a default route, for example Tailscale with an exit node. Otherwise HTTP stays on the picked transport, and raw connections are `ENETUNREACH`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.12.1",
3
+ "version": "1.13.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",