@ai-ecoverse/slicc-bios 2.8.1 → 2.8.3

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 +3 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -542,13 +542,13 @@ Programs ask seven's page for what only a page can do through the kernel's `/dev
542
542
  - **Before the body:** the same switch, the same refusals and the same gesture check as `serve.publish`, with "Publish a snapshot of /home/site (2 files, 1.8 KiB) at a public URL for 7 days?" (dismissed texts `the request to publish the snapshot was dismissed`, `nobody answered the request to publish the snapshot within 60 s`).
543
543
  - **Upload:** the page mints `{servedRoot, entryPath, allowLive: false, ttlMs}` with the controller token, keeps the hub's `uploadToken` in memory only, reads the body file by file and `PUT`s each to `…/preview/<token>/file?path=<path>` with the upload token and its `Content-Type`, four at a time, reporting `uploaded 12 of 40 files` through `request.progress`, then `POST`s `…/finalize`. On `*.sliccy.ai` both go through sliccy-ai's same-origin proxy ([sliccy-ai#162](https://github.com/ai-ecoverse/sliccy-ai/pull/162)).
544
544
  - **The reply:** one line `{"url","previewToken","trayId"?,"expiresAt","files","bytes"}` (`expiresAt` is the finalize time plus `ttlMs`, in ms since the epoch).
545
- - **Failures** answer at once, without reading the rest of the body, and stop whatever was minted on the hub. A body that breaks the rules, or whose files and bytes don't add up to exactly `files` and `bytes`, is `EIO`, `bad snapshot body: <what>`. A refusal the hub answered is the reply line of `serve.publish` with `"during": "mint"`, `"upload"` (and its `"path"`) or `"finalize"`. A hub that can't be reached is `EIO`. A program that goes away first aborts the request, and a snapshot not yet finalized is stopped.
545
+ - **Failures** answer at once, without reading the rest of the body, and stop whatever was minted on the hub. A body that breaks the rules, or whose files and bytes don't add up to exactly `files` and `bytes`, is `EIO`, `bad snapshot body: <what>`. A refusal the hub answered is the reply line of `serve.publish` with `"during": "mint"`, `"upload"` (and its `"path"`) or `"finalize"`. A hub that can't be reached is `EIO`. A program that goes away before the page has written its reply aborts the request, and the snapshot is stopped on the hub, even when its finalize was in flight and succeeds (#1801); once the reply is written, the snapshot stays, since `serve` may have read it.
546
546
  - **Kept:** a finalized snapshot outlives the page, so seven keeps `{previewToken, url, root?, entry?, since, expiresAt, uid, trayId, files, bytes}` in `localStorage` (`slicc-os.snapshots`, out of every program's reach) until it expires or is stopped, and the boot sweep leaves persistent previews alone.
547
547
  - **Whose:** each preview keeps the uid of the process that published it.
548
548
  - **`serve.list`:** one JSON line per preview of the caller's uid (every one for root): a live one as `{previewToken, url, root?, port, entry?, since}`, a snapshot as `{previewToken, url, root?, entry?, since, mode: "persistent", expiresAt}` (times in ms since the epoch), and an empty reply when there are none.
549
- - **`serve.stop`** (`{"kind":"serve.stop","previewToken":"…"}`, an empty reply): ends a live preview's `serve.publish` reply with `stopped with serve --stop`, or forgets a kept snapshot, and revokes it on the hub (`POST …/preview/stop`). A token seven doesn't hold is revoked on the tray all the same. One the hub doesn't know either, and a held preview of another uid for a caller who isn't root, is `ENOENT`, `the tray hub has no such preview`.
549
+ - **`serve.stop`** (`{"kind":"serve.stop","previewToken":"…"}`, an empty reply): ends a live preview's `serve.publish` reply with `stopped with serve --stop`, or forgets a kept snapshot once the hub has revoked it (a stop that fails keeps it, so it can be stopped again), and revokes it on the hub (`POST …/preview/stop`). A token seven doesn't hold is revoked on the tray all the same. One the hub doesn't know either, and a held preview of another uid for a caller who isn't root, is `ENOENT`, `the tray hub has no such preview`.
550
550
  - **Refusals:** no tray hub (a seven off `*.sliccy.ai` without `slicc-os.tray-hub`) is `ENOTSUP`, `seven publishes previews only through its tray hub, and it has none here`; a tab that doesn't run the kernel (another seven tab of the same browser) is `ENOTSUP`, `seven publishes only from the tab that runs its kernel; run serve in that tab's terminal`; a tray not connected yet, a hub that can't be reached and a bad `port` or `entry` (`invalid port`, `invalid entry`) are `EIO` with the reason. The kinds' policies are `{}`: the kernel admits a process of the session's own uid, so a cone's agent publishes in its own session, and `sudo -u cone` in root's terminal is refused before the page sees it. A remote follower's shell has no page hook, so `serve` there is `ENOTSUP` before the page sees it.
551
- - **Tests:** `test/integration/previews.test.mjs` publishes `httptest` on a fake tray hub from a raw `/dev/embedder` request, checks the mint, the chip, `serve.list`, a visit, a 404 from the server, a path outside the served root (403) and a root nobody serves (404), then ends a preview every way (the program killed, the chip's Stop, the hub's revoke, `serve.stop`, the switch, a reload) and checks each one is revoked with its `stopped` line, that a cone's session lists none of root's previews and can't stop one, and that a hub's 429 comes back as the reply's `error` line, while an orphan on the tray is revoked at boot and a persistent preview isn't. `test/integration/previews-serve.test.mjs` installs `serve` from the catalog, runs `serve --local` and publishes its port: text, a 300 000-byte binary file in seven chunks, ranges (a window, a suffix, an unsatisfiable one), a 404, a 25 MiB+1 file refused with 413 and an 8 MiB window of it. `test/integration/previews-snapshot.test.mjs` sends `serve.snapshot` bodies from the terminal to a fake tray hub: three files (a 70 000-byte binary among them) uploaded with the upload token and their types and finalized, the reply, `serve.list` before and after a reload that doesn't revoke it, an upload the hub refuses (`during: "upload"` with its path, then stopped), a body that announces fewer bytes than it carries (`EIO`, stopped), a mint refused with `PREVIEW_LIMIT`, the switch off, and `serve.stop`, after which the hub no longer serves it and `localStorage` keeps nothing.
551
+ - **Tests:** `test/integration/previews.test.mjs` publishes `httptest` on a fake tray hub from a raw `/dev/embedder` request, checks the mint, the chip, `serve.list`, a visit, a 404 from the server, a path outside the served root (403) and a root nobody serves (404), then ends a preview every way (the program killed, the chip's Stop, the hub's revoke, `serve.stop`, the switch, a reload) and checks each one is revoked with its `stopped` line, that a cone's session lists none of root's previews and can't stop one, and that a hub's 429 comes back as the reply's `error` line, while an orphan on the tray is revoked at boot and a persistent preview isn't. `test/integration/previews-serve.test.mjs` installs `serve` from the catalog, runs `serve --local` and publishes its port: text, a 300 000-byte binary file in seven chunks, ranges (a window, a suffix, an unsatisfiable one), a 404, a 25 MiB+1 file refused with 413 and an 8 MiB window of it. `test/integration/previews-snapshot.test.mjs` sends `serve.snapshot` bodies from the terminal to a fake tray hub: three files (a 70 000-byte binary among them) uploaded with the upload token and their types and finalized, the reply, `serve.list` before and after a reload whose boot sweep revokes an orphan and not the snapshot, an upload the hub refuses (`during: "upload"` with its path, then stopped), a body that announces fewer bytes than it carries (`EIO`, stopped), a mint refused with `PREVIEW_LIMIT`, a program killed while the hub holds its finalize (the finalize is released once the program is gone from `ps`; the snapshot is stopped and not kept), the switch off, a `serve.stop` the hub fails (non-zero, and `serve.list` still shows the snapshot), and a second `serve.stop`, after which the hub no longer serves it and `localStorage` keeps nothing.
552
552
  - Kinds seven doesn't list (`open.file`, `open.download`, `open.reveal`, `clipboard.read`) are `ENOTSUP` before the page sees them.
553
553
 
554
554
  ### Composer recording
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
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",