@ai-ecoverse/slicc 1.53.0 → 1.54.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 +10 -5
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  | `slicc` | pick browsers in a small TUI; Enter launches or attaches to the best match, opens seven and links it. With no SLICC profile and no CDP endpoint, its best match links seven in the default browser instead, and without a terminal slicc does that by itself (works now; see [The default](#the-default-slicc)) |
12
12
  | `slicc attach --cdp <url>` | link a seven that is open in an already-running CDP browser (works now; see [Local setup](#local-setup-slicc-attach)) |
13
13
  | `slicc open`, `slicc --default-browser`, `slicc pair` | link a seven in your everyday browser, without CDP: open or print a pairing URL (works now; see [Linking seven in your everyday browser](#linking-seven-in-your-everyday-browser)) |
14
- | `slicc unpair [<fingerprint> \| --all]` | list or forget the sevens paired with `open` or `pair` |
14
+ | `slicc unpair [<fingerprint> \| --all] [--json]` | list or forget the sevens paired with `open` or `pair`, and close their live links |
15
15
  | `slicc tray [--json] [-q] [-a]` | list the `slicc` processes on this machine that hold a link: mode, seven, device, state and offers (works now; see [Running links](#running-links-slicc-tray)) |
16
16
  | `slicc launch` | launch a browser with CDP in a separate SLICC profile and print its CDP URL |
17
17
  | `slicc <join-url> follow [--exit] [--runner …] [--cdp <url>] [--mount <path>]` | follow a seven's tray from another machine and offer its network, compute (over SSH), browsers or folders (`--exit`, `--runner`, `--cdp` and `--mount` work now; see [Remote setup](#remote-setup-slicc-join-url-follow)). `-` or `@<file>` in place of `<join-url>` reads it from stdin or a file, out of sight of `ps` |
@@ -320,6 +320,7 @@ Release builds (a plain `X.Y.Z` version, linked in or, for `go install`, from th
320
320
  | `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 |
321
321
  | `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 |
322
322
  | `SLICC_CDP_GUARD_IDLE`, `SLICC_CDP_GUARD_LIMIT` | test-only: Go durations (such as `2s`) that shorten the [`cdp`](#cdp-browser-control) guard's idle bound (30 s) and outer bound (5 min) on a target's setup and on a session it doesn't know yet. A longer value counts as the default, and so does 0, a negative value or one that doesn't parse, so the variables can never widen or turn off the guard |
323
+ | `SLICC_LOOPBACK_ANSWER_DELAY` | test-only: a Go duration (at most 5 s) that the [loopback listener](#linking-seven-in-your-everyday-browser) waits after a signal's pin check and before it answers, so tests can unpair a page in between |
323
324
  | `SLICC_LOOPBACK_PORTS` | test-only: `<first>-<last>`, the port range of the [loopback listener](#linking-seven-in-your-everyday-browser) instead of 17117-17126 |
324
325
  | `SLICC_LINK_URL` | inside seven only: the link facade's address, `tcp://127.0.0.1:<port>` (see [Inside seven](#inside-seven)) |
325
326
  | `SLICC_USER_DATA_DIR`, `XDG_STATE_HOME` | read, as SLICC six reads them, only to find six's Chrome profile (see [Using SLICC six's Chrome profile](#using-slicc-sixs-chrome-profile)) |
@@ -646,7 +647,7 @@ slicc open [--page <url>] [--origin <origin>]... [--name <name>] [--allow <rule>
646
647
  [--runner <argv…> [--]] [--shell <argv…> [--]] [--eval <argv…> [--]] [--eval-quiet <dur>] [--sftp | --no-sftp] [--json]
647
648
  slicc pair [the same flags]
648
649
  slicc --default-browser [the same flags]
649
- slicc unpair [<fingerprint> | --all]
650
+ slicc unpair [<fingerprint> | --all] [--json]
650
651
  ```
651
652
 
652
653
  Link spec §1.3. These commands link a seven that runs in the browser you use every day (Chrome, Edge or Firefox; Safari and other WebKit browsers can't, see [§1.3](#13-local-setup-without-cdp-loopback-signalling)), without CDP or remote debugging, as slicc-node could. Only the setup is new: once the peer connection is up, the link is the same as for `slicc attach` (see [Link](#link)).
@@ -701,7 +702,9 @@ The URL is the secret, and it carries the node's fingerprint, so a process that
701
702
 
702
703
  **Unlinking.**
703
704
  - **From seven:** on a live link, seven opens `OPEN { "kind": "unlink" }` (cap `unlink-loopback`). The node answers OPENED `{}` and END, deletes that page's pin, closes that link only, and says `unlinked by seven on <origin> (ab12…ef); it must pair again to link`. It keeps running and keeps its certificate.
704
- - **On the node:** `slicc unpair` lists the pins, one line each: `<page-fp> <origin> paired <time>`, or `no paired sevens`. `slicc unpair <fingerprint>` forgets one. A unique prefix works, ignoring colons and case. It says `forgot ab12…ef (<origin>)`, and exits 1 when nothing matches or more than one pin does. `slicc unpair --all` forgets every pin (`forgot <n> paired sevens`). A link that is up stays up until it drops, and a forgotten page gets `403` on its next signal. Once a link is down and its page is no longer pinned, the node lets go of everything it kept for that page.
705
+ - **On the node:** `slicc unpair` lists the pins, one line each: `<page-fp> <origin> paired <time>`, or `no paired sevens`. `slicc unpair <fingerprint>` forgets one. A unique prefix works, ignoring colons and case. It says `forgot ab12…ef (<origin>)`, and exits 1 when nothing matches or more than one pin does. `slicc unpair --all` forgets every pin (`forgot <n> paired sevens`). A forgotten page gets `403` on its next signal.
706
+ - **Live links close at once:** after forgetting the pins, `slicc unpair` asks every running `open`, `pair` and default-browser `slicc` of this user, over its [control socket](#running-links-slicc-tray), to close the link of each forgotten page: `{ "v": 1, "op": "revoke", "fingerprint": "<page-fp>" }`, answered `{ "v": 1, "ok": true, "closed": true }` when that process held such a link and closed it (`closed` is left out otherwise). It says `slicc unpair: closed the live link of ab12…ef` on stderr for each. A link whose offer passed the pin check just before `unpair` is closed too, as it comes up: the node checks the pin again when it sets up each link, and closes one whose page is no longer pinned (`seven on ab12…ef was unpaired while it linked; closed its link`). `--json` goes before or after the fingerprint. **A process too old to know `revoke`** (its status has no `revoke` in `ops`) **keeps its link until it drops**, as before; restart it to drop the link at once.
707
+ - **`--json`:** one JSON document on stdout, nothing else there, errors on stderr. Listing: `{"schema":1,"peers":[{"fingerprint","origin","node","firstSeen","live"}]}`, where `node` is the node identity the page paired with, and `live` is `true` while a running process holds a link with it (from the `peers` of its status). Forgetting, with `<fingerprint>` or `--all`: `{"schema":1,"removed":[<page-fp>…],"closed":[<page-fp>…]}`, the pins forgotten and the live links that closed. Fixture: [`unpair.ndjson`](test/integration/testdata/native/unpair.ndjson). Once a link is down and its page is no longer pinned, the node lets go of everything it kept for that page.
705
708
 
706
709
  **The page side**, as the test harness implements it (`test/integration/testdata/link/loopback.js`, the reference for seven):
707
710
  1. `RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256" })` once per origin, kept in IndexedDB (`slicc-loopback`, store `keys`, key `certificate`) and passed as `certificates` to every loopback `RTCPeerConnection`.
@@ -1374,8 +1377,9 @@ PID MODE SEVEN DEVICE STATE OFFERS
1374
1377
  - **`DEVICE`:** this machine's device, as `follow` and seven's tray see it: for `follow`, the DTLS certificate for that hub, and for `open` and `pair`, the loopback identity. It is the SHA-256 fingerprint, shown as its first and last four hex digits, so a row here matches a row in the leader's `slicc tray`. Over CDP there is none (`-`).
1375
1378
  - **`STATE`:** `waiting` (a local mode, until seven links), `dialing`, `waiting for offer`, `connecting`, `connected` with how long, `reconnecting (#<attempt>, <next wait>)`, or `stopped (<code>)` with the hub's or seven's code (`TRAY_EXPIRED`, `UNLINKED`, …) as the process exits.
1376
1379
  - **`OFFERS`:** `exit` (the network, `--exit` for `follow`), `ssh`, `cdp`, `jerk`, `fs:<name>` per folder, and `kernel:<port>`.
1377
- - **`--json`:** a JSON array, one object per process: `{ "v": 1, "pid", "mode", "version", "started", "seven"?, "origin"?, "hub"?, "device"?, "state", "since", "attempt"?, "retryAt"?, "code"?, "error"?, "offers", "dials", "links", "lastLinked"?, "ops"? }`. `ops` lists the control ops the process answers (see *Control sockets* below); it is missing from a process older than that field. `hub` is the hub's origin, `error` the last failure with secrets redacted, `dials` the dials so far and `links` the links that came up. These are SLICC six's follower counters.
1380
+ - **`--json`:** a JSON array, one object per process: `{ "v": 1, "pid", "mode", "version", "started", "seven"?, "origin"?, "hub"?, "device"?, "state", "since", "attempt"?, "retryAt"?, "code"?, "error"?, "offers", "dials", "links", "lastLinked"?, "ops"?, "peers"? }`. `ops` lists the control ops the process answers (see *Control sockets* below); it is missing from a process older than that field. `hub` is the hub's origin, `error` the last failure with secrets redacted, `dials` the dials so far and `links` the links that came up. These are SLICC six's follower counters.
1378
1381
  - **`-q`:** only the PIDs, one per line, for `slicc tray -q | xargs kill`. There's no `stop`.
1382
+ - **`peers`:** on `open`, `pair` and the default flow's default-browser mode, the fingerprints of the pages it holds a link with (left out when none).
1379
1383
  - **`-a`:** also the trays this machine knows but isn't following now, from `tray-certs.json` and `tray-join.json`, as `docker ps -a` does: PID `-`, state `not running`, the leader's name from the last link and the device for that hub. Neither file's join URL is shown.
1380
1384
 
1381
1385
  **Control sockets.** Each of those processes serves a control socket while it runs, `<dir>/<pid>.sock`, and removes it on exit.
@@ -1388,10 +1392,11 @@ PID MODE SEVEN DEVICE STATE OFFERS
1388
1392
  - **macOS and Linux:** the directory is `0700`, must belong to the user and not be a symlink, and is tightened when it's more open. Each connection checks the peer's uid (`SO_PEERCRED` on Linux, `LOCAL_PEERCRED` on macOS) and closes on anyone else.
1389
1393
  - **Windows:** slicc sets the directory's DACL to the user and SYSTEM only, protected from inheritance, so the sockets in it inherit it. `slicc tray` skips a directory whose DACL is anything else.
1390
1394
  - **Either way,** a process that can't serve a socket there runs on without one.
1391
- - **The protocol:** one line of JSON each way, then the process closes the connection. The ops, same-uid only as above:
1395
+ - **The protocol:** one line of JSON each way, then the process closes the connection. The ops, same-uid only as above (`status` lists the ones a process answers):
1392
1396
  - `{ "v": 1, "op": "status" }`, answered with the status object above. Its `ops` lists the ops this process answers, `status` first, so a client can tell what a running `slicc` of another version supports; a process from before `ops` existed answers only `status`.
1393
1397
  - `{ "v": 1, "op": "stop" }`: exactly what `SIGTERM` does. The process says `bye` to seven, closes the browsers this run launched, and exits 0; `closed.browsers` lists them with `--json`.
1394
1398
  - `{ "v": 1, "op": "detach" }`: the process says `bye` to seven, stops the link, and leaves every browser running, the ones it launched too; with `--json`, `closed` has `browsers: []` and `kept`, the ids of the launched browsers left running (`[]` on `attach`, `open`, `pair` and `follow`, which launch none). A kept browser is found again by the next run: its `DevToolsActivePort` in its SLICC profile leads discovery to it with its seven tab open, and the next `slicc` attaches to it (`attached` with no `launched`) and links that tab.
1399
+ - `{ "v": 1, "op": "revoke", "fingerprint": "<page-fp>" }`, on `open`, `pair` and the default-browser mode: close the link with that page, if any, and answer `{ "v": 1, "ok": true, "closed"?: true }` once it has. `slicc unpair` sends it (see [Linking seven in your everyday browser](#linking-seven-in-your-everyday-browser)). A missing fingerprint is `EINVAL`.
1395
1400
  - `stop` and `detach` are answered `{ "v": 1, "ok": true }` before the process acts. A process that doesn't know an op answers `{ "v": 1, "error": "EINVAL" }`, and a line that isn't a request of version 1 gets `EPROTO`.
1396
1401
  - Signals don't change: `SIGINT` and `SIGTERM` still stop, except that `slicc --keep-browsers` makes `SIGTERM` detach.
1397
1402
  - **Stale sockets:** liveness comes from connecting, not from the PID, so a reused PID can't fool `slicc tray`. A socket that refuses a connection is stale, and `slicc tray` removes it and says so on stderr, as `screen -wipe` does.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc",
3
- "version": "1.53.0",
3
+ "version": "1.54.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.53.0",
22
- "@ai-ecoverse/slicc-darwin-amd64": "1.53.0",
23
- "@ai-ecoverse/slicc-linux-arm64": "1.53.0",
24
- "@ai-ecoverse/slicc-linux-amd64": "1.53.0",
25
- "@ai-ecoverse/slicc-windows-arm64": "1.53.0",
26
- "@ai-ecoverse/slicc-windows-amd64": "1.53.0",
21
+ "@ai-ecoverse/slicc-darwin-arm64": "1.54.0",
22
+ "@ai-ecoverse/slicc-darwin-amd64": "1.54.0",
23
+ "@ai-ecoverse/slicc-linux-arm64": "1.54.0",
24
+ "@ai-ecoverse/slicc-linux-amd64": "1.54.0",
25
+ "@ai-ecoverse/slicc-windows-arm64": "1.54.0",
26
+ "@ai-ecoverse/slicc-windows-amd64": "1.54.0",
27
27
  "@ai-ecoverse/slicc-jerk": "^1.3.9"
28
28
  }
29
29
  }