@ai-ecoverse/slicc 1.65.0 → 1.66.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 +24 -4
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -177,7 +177,8 @@ Six's `--version`, `version`, `--profile` and `--mount` are seven flags too, and
177
177
  **Restarts.** slicc-node kept its key and port, so an open page reconnected after a restart. `slicc` sets the link up again instead:
178
178
  - A browser that `slicc` launched runs in its own process group. It outlives a `slicc` that crashes or is killed.
179
179
  - The next `slicc` finds that browser's seven tab and links it again, with `attached` and no `launched`. It finds the tab through the profile's `DevToolsActivePort`, or through `--cdp`. Given the same `--mount` and `--kernel-port`, the folders and kernel services come back too.
180
- - Quitting `slicc` normally (`q`, Ctrl-C, `SIGTERM`, or the control socket's `stop`) closes the browsers that run launched. The control socket's `detach`, or `SIGTERM` with `--keep-browsers`, leaves them running, for the next run to link again (see [Running links](#running-links-slicc-tray)).
180
+ - Quitting `slicc` normally (`q`, Ctrl-C, `SIGTERM`, or the control socket's `stop`) closes the browsers that run launched. The control socket's `detach`, `SIGTERM` with `--keep-browsers`, or `d` in the dashboard, leaves them running, for the next run to link again (see [Running links](#running-links-slicc-tray)).
181
+ - `u` in the dashboard updates `slicc` and restarts it in place, without closing those browsers (see [Updating from the dashboard](#updating-from-the-dashboard)).
181
182
  - Every new `slicc` process has a new `node` id, so seven sees a new link from the same machine.
182
183
  - `attach` sets up again on every new seven context, and `follow` reconnects by itself, with the same device certificate.
183
184
  - `slicc open` and `slicc pair` keep their certificate and port, so a paired page signals again after a restart, without a new pairing.
@@ -291,7 +292,7 @@ Errors name the step that failed (`attestation identity: …`). A bundle from a
291
292
 
292
293
  ## Updates
293
294
 
294
- `slicc update [--check] [--checksum-only]` replaces the running binary (symlinks resolved), wherever it is, such as `~/.local/bin/slicc` from `install.sh`, with the latest GitHub release of `ai-ecoverse/slicc-cli`. It downloads the asset for this OS and CPU, checks it against the release's `SHA256SUMS`, and verifies its build provenance attestation (see [Attestations](#attestations)); `--checksum-only` skips the attestation, with a warning. The new binary has to answer `--version` with the release's version before anything is replaced. The swap is a rename next to the old binary; on Windows the running binary is first moved aside to `<name>.old`, which the next run deletes. `slicc update --check` only reports.
295
+ `slicc update [--check] [--checksum-only]` replaces the running binary (symlinks resolved), wherever it is, such as `~/.local/bin/slicc` from `install.sh`, with the latest GitHub release of `ai-ecoverse/slicc-cli`. It downloads the asset for this OS and CPU, checks it against the release's `SHA256SUMS`, and verifies its build provenance attestation (see [Attestations](#attestations)); `--checksum-only` skips the attestation, with a warning. The new binary has to answer `--version` with the release's version before anything is replaced. The swap is a rename next to the old binary; on Windows the running binary is first moved aside to `<name>.old`, which the next run deletes. When a `<name>.old` is still in use (a dashboard restarted after `u` keeps the old process waiting on the new one), it is moved to `<name>.old-<n>` instead, and the next run deletes those it can too. `slicc update --check` only reports.
295
296
 
296
297
  **Where the release comes from.** The GitHub API allows 60 requests an hour per IP address without a token, which a shared network or CI runner uses up, so `update`, `install` and the notice don't need it. They ask `https://github.com/<repo>/releases/latest` without following its redirect, take the version from the `/releases/tag/v<version>` it points to (a tag that isn't `v` and dot-separated numbers is refused), and download `SHA256SUMS`, `<asset>` and `SHA256SUMS.sigstore.json` from `https://github.com/<repo>/releases/download/v<version>/`, the same files `install.sh` takes. A release whose `SHA256SUMS` has no line for this platform's asset is refused with `release <version> has no <asset>` before the asset is downloaded. Only the tag is read from the redirect; the download URLs are built from the base, never taken from the answer. When github.com doesn't name a release, they fall back to `GET /repos/<repo>/releases/latest` on the API. With `GH_TOKEN` (or else `GITHUB_TOKEN`) set, every API request carries it as a bearer token (5,000 requests an hour); it goes to `/repos/` on the API base only, never to github.com or a download. When the API answers 403 or 429 with no requests left, the error says `GitHub's API rate limit is used up`, and without a token adds `set GH_TOKEN or GITHUB_TOKEN for a higher one`.
297
298
 
@@ -307,6 +308,22 @@ These checks come first, so `--check` refuses the same way and nothing asks GitH
307
308
 
308
309
  Release builds outside npm and app bundles print a notice on stderr when a newer release exists: ``slicc X is available (you have Y); run `slicc update` ``. A go-installed release says ``run `go install github.com/ai-ecoverse/slicc-cli/cmd/slicc@latest` `` instead. The notice comes from a cache (`<user cache dir>/slicc/update-check-seven.json`; six's Go follower uses `update-check.json`, see [Coming from SLICC six](#coming-from-slicc-six)), and a background check refreshes it at most once every 24 hours, so no run waits on the check for more than 2 seconds. `--version`, `capabilities`, `update`, and any command line with `--help`, `-h` or `-help` print no notice.
309
310
 
311
+ ### Updating from the dashboard
312
+
313
+ `u` in the dashboard updates `slicc` and restarts it, without closing the browsers it launched or the seven tab in them. It is offered only where `slicc update` would replace the binary: a release build, not go-installed, outside npm and app bundles. Elsewhere the key bar has no `u`.
314
+
315
+ 1. **Update.** slicc finds the latest release, downloads it, checks it against `SHA256SUMS` and its attestation, and replaces the binary, exactly as `slicc update` does (there is no `--checksum-only` here). RECENT says `looking for a newer slicc`, then `updating slicc X to Y`. When slicc is up to date, or a step fails, RECENT says so (a failure in red) and the run goes on; `u` can be pressed again. While it runs the key bar reads `u updating…`, and another `u` does nothing.
316
+ 2. **Detach.** Once the new binary is in place, RECENT says `updated to slicc Y (SHA256SUMS and attestation checked); restarting`, and slicc detaches as `d` does: `bye` to seven, every browser left running. A `q` or Ctrl-C that came first wins: slicc then quits as usual, closing its browsers, and doesn't restart; the new binary is still in place for the next run.
317
+ 3. **Restart.** slicc runs the new binary with the same arguments. On macOS and Linux it replaces the process (`execve`), so the PID, the terminal and the parent stay; on Windows it starts the new binary as a child on the same console, waits for it, and exits with its exit code; the old binary, parked as `<name>.old` or `<name>.old-<n>`, stays in use until then, so a second `u` in the child parks the binary at the next free name (see [Updates](#updates)). The new process gets `SLICC_RESUME`, a JSON document of what to resume, and removes it from its environment before anything else, so nothing it starts inherits it:
318
+ - **`browsers`:** the CDP URL and name of each browser the dashboard showed, also one launched and not yet attached, the one hosting seven first and none that was `gone`, and `launched` for the ones the old process launched (or adopted, see below).
319
+ - **`pair`:** after `Default browser`, instead of `browsers`.
320
+ - **`settings`:** the capabilities as the dashboard last applied them (shell, kernel port, folders, jerk), which take the place of `--mount`, `--kernel-port`, `--no-kernel` and `--no-jerk`, so changes made with `c` and `m` survive. Not after `Default browser`, whose capabilities come from the command line.
321
+ 4. **Resume.** The new process adds those CDP URLs to discovery, skips the picker, and goes straight to the dashboard with those browsers, attaching to each one and linking the seven tab again, as a new `slicc` does after a `detach` (see *Restarts* in [Coming from slicc-node](#coming-from-slicc-node)). An extra that no longer answers is left out. When the browser that hosted seven doesn't answer, the picker comes up as usual. After `Default browser` it pairs again on the kept certificate and port, so the paired page signals again by itself.
322
+
323
+ **Adopted browsers.** A browser marked `launched` in `SLICC_RESUME` is adopted: the dashboard shows it as `launched`, `q` closes it (with CDP's `Browser.close`, since the new process has no handle on it), `d` and the next `u` leave it running, and `closed` lists it under `browsers` or `kept` by its endpoint id (`cdp:127.0.0.1:<port>`). So a run looks the same before and after `u`.
324
+
325
+ `SLICC_RESUME` is internal to the restart: it is read only by `slicc` with no command in the dashboard (a terminal and no `--yes`, `--browser`, `--plain` or `--json`), a value that isn't version 1 is ignored, and it grants nothing the command line can't: the same CDP URLs could be given with `--cdp`, the same folders with `--mount`.
326
+
310
327
  ## Telemetry
311
328
 
312
329
  Release builds (a plain `X.Y.Z` version, linked in or, for `go install`, from the module version) send operational telemetry through [go-optel](https://github.com/ai-ecoverse/go-optel) with the app id `slicc-cli`, sampled once per process (1 in 100 by default):
@@ -328,6 +345,7 @@ Release builds (a plain `X.Y.Z` version, linked in or, for `go install`, from th
328
345
  | `SLICC_TELEMETRY_URL` | telemetry collector base (default `https://rum.hlx.page/`) |
329
346
  | `OPTEL_RATE`, `OPTEL_DEBUG` | go-optel's sampling rate and beacon logging |
330
347
  | `SLICC_LAUNCHER` | set to `npm` by the npm launcher; removed from the environment that `slicc` passes on |
348
+ | `SLICC_RESUME` | internal: what a dashboard restart after `u` resumes; set by `slicc` for the new binary and removed by it at start (see [Updating from the dashboard](#updating-from-the-dashboard)) |
331
349
  | `SLICC_DISCOVERY` | test-only: limits browser discovery, see [Development](#development) |
332
350
  | `SLICC_OPEN_COMMAND` | test-only: `slicc open` runs this program with the pairing URL as its only argument instead of opening the default browser; the integration tests always set it |
333
351
  | `SLICC_PROTECTED_PORTS` | test-only: `<first>-<last>` (or one port), more [debugging ports](#network-policy) denied in every mode on top of 9222-9229 (never instead of them), so tests can prove the range on fake ports without touching the real ones. A malformed value exits 1 |
@@ -454,10 +472,12 @@ The cdp list follows the browsers: an extra that stops answering is taken off th
454
472
  | `e`, `h` | open or close the Electron apps and the headless browsers |
455
473
  | Esc | back, in the profile chooser |
456
474
  | `q`, Ctrl-C | quit; in the dashboard, close down as described above |
475
+ | `d` | in the dashboard: detach, as the control socket's `detach` does: say `bye` to seven, leave every browser running, the ones this run launched too, and exit 0 with `slicc: detached; left <ids> running; run slicc to link seven there again` on stderr (`slicc: detached` when it left none). Not on the dashboard after `Default browser`, which launches none |
476
+ | `u` | in the dashboard, also after `Default browser`: update `slicc` and restart it without closing its browsers (see [Updating from the dashboard](#updating-from-the-dashboard)). Offered only where `slicc update` would replace this binary |
457
477
 
458
- **The dashboard** follows, in sections: BROWSERS (launched or attached, their CDP port, hosts seven or extra, `gone` while one doesn't answer, and `unlisted` for an extra left off the cdp list because it has no browser session; a row shows at most one of the two, and each new link, a relink too, clears both and marks what it reports again); SEVEN (the tab, the link state (`waiting for seven`, `connecting`, `linked` with its uptime, `reconnecting` after a link is lost, while slicc waits for seven to offer again, or `relinking` while new capabilities are applied), the policy summary, and stream counts per kind, open and total, never contents); CAPABILITIES (the network capabilities always offered, then `jerk`, `shell` with `ssh via <runner>`, `kernel` with its URL, or why it is off, and the shared folders); RECENT (the last status lines, links in green, losses in yellow, errors in red); and the update notice, which then isn't printed on stderr. Keys: `c` capabilities, `m` share a folder, `q` quit. `NO_COLOR` turns colors off.
478
+ **The dashboard** follows, in sections: BROWSERS (launched or attached, their CDP port, hosts seven or extra, `gone` while one doesn't answer, and `unlisted` for an extra left off the cdp list because it has no browser session; a row shows at most one of the two, and each new link, a relink too, clears both and marks what it reports again); SEVEN (the tab, the link state (`waiting for seven`, `connecting`, `linked` with its uptime, `reconnecting` after a link is lost, while slicc waits for seven to offer again, or `relinking` while new capabilities are applied), the policy summary, and stream counts per kind, open and total, never contents); CAPABILITIES (the network capabilities always offered, then `jerk`, `shell` with `ssh via <runner>`, `kernel` with its URL, or why it is off, and the shared folders); RECENT (the last status lines, links in green, losses in yellow, errors in red); and the update notice, which then isn't printed on stderr. Keys: `c` capabilities, `m` share a folder, `d` detach, `u` update (when offered), `q` quit. `NO_COLOR` turns colors off.
459
479
 
460
- **The dashboard after `Default browser`** links seven over loopback, as `slicc open` does, and opens the pairing URL in the default browser. In place of BROWSERS it shows `Default browser paired over loopback · no cdp hosts seven`; SEVEN starts with the pairing URL (a link where the terminal supports it, wrapped to the terminal's width, good once, for 10 minutes) until seven links, then `↵ for a URL to pair another seven`. The other sections are as above. Its capabilities are those of the command line: the capabilities screen and `m` aren't offered, so changing them means restarting slicc. Keys: `↵` a new pairing URL, `y` copies the URL to the clipboard (OSC 52), `q` quit.
480
+ **The dashboard after `Default browser`** links seven over loopback, as `slicc open` does, and opens the pairing URL in the default browser. In place of BROWSERS it shows `Default browser paired over loopback · no cdp hosts seven`; SEVEN starts with the pairing URL (a link where the terminal supports it, wrapped to the terminal's width, good once, for 10 minutes) until seven links, then `↵ for a URL to pair another seven`. The other sections are as above. Its capabilities are those of the command line: the capabilities screen and `m` aren't offered, so changing them means restarting slicc. Keys: `↵` a new pairing URL, `y` copies the URL to the clipboard (OSC 52), `u` update (when offered), `q` quit.
461
481
 
462
482
  **Capabilities at runtime.** `c` opens the capabilities screen: `jerk` (when slicc-jerk is installed), `shell` (the `--runner`; turning it on uses `$SHELL -c`, or `pwsh -Command` / `powershell -Command` on Windows), `kernel` (the `--kernel-port`, or off) and the shared folders, each `path[:name][:ro]` as for `--mount`, with tab completing folders. `space` turns a row on or off, `↵` edits it, `a` adds a folder, `r` makes a folder read-only, `x` removes it. Changes collect as pending until `s` applies them (`u` undoes them; leaving with `esc` asks first). Folder changes go live as a mount update (see [Host folders](#host-folders)) when folders are already shared and seven takes `mounts` updates. Every other change relinks: the node says `bye` with the reason `slicc is relinking`, the browsers and the CDP connection stay, and a new node with the new capabilities sends seven's tab a fresh `hello` with the same `node` id, so seven offers again and replaces the link. Streams open on the old link close. A runner changed in the TUI drops `--shell`, `--eval`, `--eval-quiet` and `--sftp` / `--no-sftp`, which belong to the runner given on the command line.
463
483
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc",
3
- "version": "1.65.0",
3
+ "version": "1.66.0",
4
4
  "description": "SLICC's command line for seven: links a machine's network, compute and browsers to seven over WebRTC",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -18,12 +18,12 @@
18
18
  "node": ">=18"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@ai-ecoverse/slicc-darwin-arm64": "1.65.0",
22
- "@ai-ecoverse/slicc-darwin-amd64": "1.65.0",
23
- "@ai-ecoverse/slicc-linux-arm64": "1.65.0",
24
- "@ai-ecoverse/slicc-linux-amd64": "1.65.0",
25
- "@ai-ecoverse/slicc-windows-arm64": "1.65.0",
26
- "@ai-ecoverse/slicc-windows-amd64": "1.65.0",
21
+ "@ai-ecoverse/slicc-darwin-arm64": "1.66.0",
22
+ "@ai-ecoverse/slicc-darwin-amd64": "1.66.0",
23
+ "@ai-ecoverse/slicc-linux-arm64": "1.66.0",
24
+ "@ai-ecoverse/slicc-linux-amd64": "1.66.0",
25
+ "@ai-ecoverse/slicc-windows-arm64": "1.66.0",
26
+ "@ai-ecoverse/slicc-windows-amd64": "1.66.0",
27
27
  "@ai-ecoverse/slicc-jerk": "^1.9.1"
28
28
  }
29
29
  }