@ai-ecoverse/slicc 1.68.3 → 1.68.5

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 +7 -5
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -933,6 +933,7 @@ Only browsers the user named are listed: the one seven runs in, `--cdp` and `--c
933
933
  `Fetch.continueRequest`, `continueResponse`, `failRequest`, `fulfillRequest`, `continueWithAuth` and `Network.continueInterceptedRequest` are refused with `slicc: refused: slicc didn't pass this paused request to the page, so it could be seven's` for any `requestId` or `interceptionId` the node hasn't passed to that session in a paused event, and for one whose pause the page has already answered successfully (until the next paused event for it). So a guessed id can't fulfil, change or fail a protected request, even one that is still paused. The node remembers the last 16 384 ids it passed on; an id older than that is refused too.
934
934
  - **Browser-wide commands**, refused with their own reason after `slicc: refused: `: `Target.exposeDevToolsProtocol` (it would give a page the whole browser) and `Target.sendMessageToTarget` (attach with `flatten: true` instead), on any target; `Fetch.enable` on the browser itself (a page session is fine); `Tracing.start`; `Extensions.loadUnpacked`; `Network.loadNetworkResource` on any session (Chrome follows its redirects itself, with the user's cookies, so an ordinary URL that redirects to seven would hand the page seven's page; a destination that is protected or doesn't parse keeps its usual refusal); `Page.captureSnapshot` (it serialises every frame, Chrome's error pages for seven's URLs included); and `Browser.setPermission`, `Browser.grantPermissions` without an `origin` and `Browser.resetPermissions`, except in a browser context this stream created.
935
935
  - **Auto-attach.** With `Target.setAutoAttach`, a session to a protected target is detached by the node at once (`Target.detachFromTarget` on its parent session), and the page never sees its `attachedToTarget` or `detachedFromTarget`.
936
+ - **Sign-in popups.** The node's guard does not hold seven's sign-in popups, and it doesn't hide the callback-only authorize tabs they lead to: seven's owner and slicc-bios do, and slicc-bios proves that with its own tests. The six shared slicc-browsers `C7.sign-in-hold.*` rows, their positives included (an ordinary popup and an ordinary authorize tab that must stay reachable), are skipped here by their own capability gate, since the guard run declares `signInHold` `false`. They will be measured on the link route once the vectors' hooks ship.
936
937
  - **Navigation by other means.** A script's `location = …`, a link, `window.open` or a server redirect isn't a command the node can refuse, so the node guards the network instead.
937
938
  - A target the stream attached to (`Target.attachToTarget`, or auto-attach that reached the page) or created (`Target.createTarget`) is *touched*, for as long as the stream is open, even after the page detached. That includes every tab the browser opens while the stream auto-attaches to new tabs. Attaching counts as touching. A protected tab opened after that touch from a page the client drives stays closable (the opener can't tell a user's click from the client's `window.open`); one that already existed when the stream started, even with that page as opener, does not.
938
939
  - On each touched page, iframe, background page or webview target the node attaches a session of its own, which the page never sees. On it, the node enables `Fetch` for document requests to protected hosts (`resourceType: Document`, request stage), and `Network` with `Network.setBypassServiceWorker`, so a service worker can't hand out a document without a request.
@@ -978,8 +979,9 @@ Only browsers the user named are listed: the one seven runs in, `--cdp` and `--c
978
979
  - **Refusals:** When a setup call fails, the node's session is lost or the target closes, both the navigation guard and any pending document confirmation fail immediately; the waiting commands, and any after them, are refused at once with `slicc: refused: slicc can't keep seven's origin out of this target`. An inherited document whose opener or parent was never confirmed stays refused with `…: inherited document has an unknown opener or parent; slicc never confirmed it`; if that opener or parent closed, the reason is `…: inherited document has a gone opener or parent`. An in-process opener frame must map to its owning target through the node's frame or execution-context bookkeeping, and that target's guard must have finished successfully without protected history. The owning target must also have no protected frames or exhausted world tracking, and must still expose a live ordinary default execution context for that opener frame when confirmation decides. A protected or ordinary opener whose context has disappeared stays refused; unknown frame ownership stays refused. When a bound fires, the message names it: `…: its guard made no progress in 30s` or `…: its guard wasn't ready in 5m0s`.
979
980
  - **Caps:** more than 4096 waiting commands, or 64 MiB of them, on one stream reset it with `ENOBUFS`.
980
981
  - **Sessions the node doesn't know.** A page command with a `sessionId` the node hasn't seen on this stream is never forwarded as it stands. The node knows a session from a `Target.attachedToTarget` it relayed or held, from the answer to the page's `Target.attachToTarget` (for a target it knows) or `Target.attachToBrowserTarget`, and from its own sessions. Commands on an unknown session wait, in order, until the session appears, then any guard setup on its target, and are then decided as usual. So a browser that answers an attach before it announces the session can't open a gap.
981
- - **Progress** for an unknown session is only a message from the browser on that session id. The browser answering other commands doesn't count, because it says nothing about this session. The bounds are a target's setup bounds (30 s idle, 5 min outer, checked every quarter of the shorter), and so are the caps.
982
- - **Refusals:** a session that never appears is refused with `slicc: refused: slicc doesn't know which target this session belongs to: its guard made no progress in 30s` (or `…: its guard wasn't ready in 5m0s`). A session the node saw detach (`Target.detachedFromTarget`; it remembers the last 4096) is refused at once with `slicc: refused: slicc doesn't know which target this session belongs to`. Another stream's session is unknown on this one, so it waits for the idle bound before it's refused.
982
+ - **Progress** for an unknown session is only a message from the browser on that session id. The browser answering other commands doesn't count, because it says nothing about this session. The idle bound is 3 s, or a target's setup idle bound if that's shorter; the outer bound (5 min) and the caps are a target's setup ones. Each unknown session has its own deadline, set when its first command arrives, so a silent session's commands are answered 3 s after it; a session that registers before its deadline is decided as usual. When the deadline comes and progress or a stop in reading moved the idle clock, the node sets it again for the time left.
983
+ - **Answers:** commands on a session that never appears, on one the node saw detach (`Target.detachedFromTarget`; it remembers the last 4096) or removed because a session above it detached (below), and on one it still holds (see *Auto-attach of targets without a URL*) never reach the browser. They get Chrome's own answer for a session it doesn't have, `{"code":-32001,"message":"Session with given id not found."}`, with their `id` and `sessionId`: at once for a detached, removed or held session, and when a bound fires for one that never appears. Another stream's session is unknown on this one, so its commands get that answer only when a bound fires.
984
+ - **Sessions under a detached one:** when the browser detaches a session, the node also removes every session it knows under it (attached on it, or on a session under it), deepest first. Each removed session the page was shown gets its own `Target.detachedFromTarget` (its `sessionId` and `targetId`), sent on that session's parent session, children before their parent and all before the browser's event for the detached session, if the page gets that; a held or hidden one gets none. Commands the browser hasn't answered yet on the detached session and on every removed one get the `-32001` answer above at once, and their later answers are dropped. A later `Target.detachedFromTarget` from the browser for a session the node already removed is dropped, so the page sees each detach once.
983
985
  - Commands without a `sessionId` don't wait.
984
986
  - In touched targets, service workers are bypassed for every request, not only for protected ones.
985
987
  - The guard covers every frame that shares the touched target's process. A cross-site iframe's navigation pauses in its parent's target, before the iframe becomes a target of its own, with the frame's id as `frameId` (the id the iframe target gets later). A popup's request pauses in the popup's target, with its `targetId` as `frameId`. A redirect into a protected origin pauses again at the request stage, with `redirectedRequestId`, even when the first URL didn't match.
@@ -995,7 +997,7 @@ Only browsers the user named are listed: the one seven runs in, `--cdp` and `--c
995
997
 
996
998
  Anything else (`Runtime.evaluate`, `DOM.*`, snapshots, screenshots and so on) is refused with `slicc: refused: the target shows Chrome's error page for a protected URL, which names it; slicc only lets a page navigate, reload or close it`. Events on its sessions are filtered too: only `Target.*`, `Inspector.*`, `Network.*`, `Fetch.*`, the `Runtime` execution-context events and the `Page` navigation, loading, frame, lifecycle, window, download and interstitial events reach the page. So console messages, exceptions, `Log` entries, `DOM`, `CSS`, `Overlay` and `Debugger` events, and `Page.screencastFrame` (a screencast the page started before the tab failed would show the error page) are dropped. The node also remembers the last 16 protected URLs a target's error pages failed to load, and replaces each of them, as is and in its percent-encoded and decoded forms, with its origin in every string of every message on that target's sessions, opaque values (`value`, `preview`, `arguments`, `returnValue`) included. A command the page sent on the target's sessions before such a commit, other than the allowed ones above, can't answer from the error page either: if its answer, an error included, arrives after the commit, the page gets `slicc: refused: the target committed Chrome's error page for a protected URL while this command ran, so slicc dropped its answer` instead (a screenshot, PDF or evaluation in flight would otherwise show the error page). Its URL and title are still redacted to the origin in listings and target events. Chrome's error pages for other URLs stay fully readable. The node tracks each touched target's main frame on its guard session (`Page.enable`): the last different-document commit (`Page.frameNavigated`) was an error page when its document is `chrome-error://chromewebdata/` (slicc-browsers' `errorPage.url`, whose `target` is `previous`) and it has an `unreachableUrl`, and that holds only while the target reports exactly that URL and no navigation is under way (`Page.frameStartedNavigating`, other than same-document, until its `Page.frameNavigated`, its document request's `Network.loadingFailed`, or the frame's `Page.frameStoppedLoading`, which also ends any doubt from an event the node couldn't read or from more than 64 navigations in flight, since nothing is in flight once the frame stops loading). Otherwise, or before the guard is ready, a protected URL locks the target as above. An error page neither locks nor unlocks: a target that was already protected stays so. An error page for a URL slicc can't parse is never exempt: it locks, as the unparseable rule says. That's stricter than slicc-browsers' `errorPage` rule, which exempts any URL's error page (nothing loaded there, so the unparseable case opens no hole the parseable one doesn't). slicc-browsers accepts it as over-protection, and no shared vector forces either answer.
997
999
  - **Auto-attach of targets without a URL.** A cross-site iframe can attach before its URL is known (`url: ""`, which stays empty while it waits for the debugger), and so can a `window.open` popup. So when an auto-attached session (one that doesn't answer the page's own `Target.attachToTarget`) is to a page or iframe target with an empty URL, the node holds it:
998
- - The page doesn't get its `attachedToTarget` yet, its events are dropped, and page commands on it are refused.
1000
+ - The page doesn't get its `attachedToTarget` yet, its events are dropped, and page commands on it get the `-32001` answer at once (see *Sessions the node doesn't know*).
999
1001
  - If the page asked for `waitForDebuggerOnStart`, the node runs `Runtime.runIfWaitingForDebugger` on it itself.
1000
1002
  - Once the target has a URL (`Target.targetInfoChanged`), a protected target's session is detached without the page seeing it. Otherwise the page gets `attachedToTarget` with the current `targetInfo` and `waitingForDebugger: false`. The target has already started, so a script the page adds for new documents in such a frame or popup misses its first one.
1001
1003
  - A target that has no URL after 10 s is treated as protected. A session that the node does forward makes the target touched (see above).
@@ -1018,7 +1020,7 @@ Only browsers the user named are listed: the one seven runs in, `--cdp` and `--c
1018
1020
 
1019
1021
  **`browsers` updates** (page cap `browsers`), node → page. When the list changes while a link is up and the page's HELLO has `browsers` in `caps`, the node opens `OPEN { "kind": "browsers", "browsers": [ … ] }` on the control channel with the full current list in HELLO's shape. It replaces the previous list; there are no deltas. The page answers OPENED `{}` and END, and the node sends END. Updates are sent one at a time per link, a change that comes while one is in flight is sent after it, with the list as it is then, and an update the page doesn't finish within 10 s is reset with `ETIMEDOUT`. A change between the HELLO and the link coming up is sent as an update right away.
1020
1022
 
1021
- `test/integration/testdata/link/link.js` is a page-side implementation of the link (framing, credit, both channel layouts, the violation rules, and `resolve` and raw-fetch helpers) that the integration tests run in Chrome against `slicc attach`. `cdp.js` next to it is a CDP client over `cdp` streams, `protect.js` probes the filter that keeps seven's origin and the browser's privileged pages out of reach, `guard.js` runs [slicc-browsers' guard vectors](https://github.com/ai-ecoverse/slicc-browsers#guard-vectors) through its `guard-runner.mjs`, with a second client straight to the test Chrome as the unguarded observer, every capability (`autoAttach`, `browserSession`, `browserContexts`, `chromeUrlsAttach`, since CDP over a DevTools port reaches `chrome://` pages, and `closeProtected`), and when `errorPageVault` remaps the C8 error-page rows onto the vault, vault documents are never closable, so the vault-remapped restore leg expects `closeRefused`, and the runner's `settleScale` at 3 on Windows, 2 on macOS and 1 on Linux, and its `refusalScale` at the default 1 (a row still running after 3 minutes fails on its own with the CDP calls it was waiting for, and the test fails after 4 minutes without a finished row, naming each row in flight and its pending calls), `fs.js` an op-shaped client for `fs` streams (`call`, `list`, `read`, `write`, `watch`), `loopback.js` is the page side of [loopback signalling](#linking-seven-in-your-everyday-browser), and `page.js` answers `browsers` and `mounts` updates. Through `linkTest.loopback`, `page.js` pairs from the fragment (`confirm`), signals again (`signal`, `reconnect`), unlinks in-band (`unlink`) and posts raw requests (`post`), with an optional `?ports=<first>-<last>` scan range. `page.js` keeps one link per `node` id from the hello. For tray links (no hello `node`) it replaces an older link with the same fingerprint only when HELLO's `node` matches, as seven does. `agent.js` is a fake agent behind the page's `agent` cap: the tests queue scripted runs, emit transcript events, hold and release a run, reset watch streams, and turn the cap off. Loaded with `?kernel`, the test page lists `kernel-in` and answers `kernel` OPENs with `kernel.js`, a small HTTP and WebSocket echo server in the page.
1023
+ `test/integration/testdata/link/link.js` is a page-side implementation of the link (framing, credit, both channel layouts, the violation rules, and `resolve` and raw-fetch helpers) that the integration tests run in Chrome against `slicc attach`. `cdp.js` next to it is a CDP client over `cdp` streams, `protect.js` probes the filter that keeps seven's origin and the browser's privileged pages out of reach, `guard.js` runs [slicc-browsers' guard vectors](https://github.com/ai-ecoverse/slicc-browsers#guard-vectors) through its `guard-runner.mjs`, with a second client straight to the test Chrome as the unguarded observer, the capabilities the link guard has (`autoAttach`, `iframeAutoAttach`, since the link route attaches out-of-process iframe targets under a page session, `browserSession`, `browserContexts`, `chromeUrlsAttach`, since CDP over a DevTools port reaches `chrome://` pages, and `closeProtected`), and `signInHold` declared `false`, since the link guard doesn't hold sign-in popups (see **Sign-in popups** in [`cdp`](#cdp-browser-control)). The six `C7.sign-in-hold.*` rows (`held-popup`, `callback`, `callback-encoded`, `callback-origin`, and the positives `ordinary-popup` and `ordinary-authorize`) are skipped by their own capability gate as `not-supported:signInHold`; `checkGuardSummary` accepts that reason only on those six rows, and any other reason on them, or that reason on any other vector, fails the run, and when `errorPageVault` remaps the C8 error-page rows onto the vault, vault documents are never closable, so the vault-remapped restore leg expects `closeRefused`, and the runner's `settleScale` at 3 on Windows, 2 on macOS and 1 on Linux, and its `refusalScale` at the default 1 (a row still running after 3 minutes fails on its own with the CDP calls it was waiting for, and the test fails after 4 minutes without a finished row, naming each row in flight and its pending calls), `fs.js` an op-shaped client for `fs` streams (`call`, `list`, `read`, `write`, `watch`), `loopback.js` is the page side of [loopback signalling](#linking-seven-in-your-everyday-browser), and `page.js` answers `browsers` and `mounts` updates. Through `linkTest.loopback`, `page.js` pairs from the fragment (`confirm`), signals again (`signal`, `reconnect`), unlinks in-band (`unlink`) and posts raw requests (`post`), with an optional `?ports=<first>-<last>` scan range. `page.js` keeps one link per `node` id from the hello. For tray links (no hello `node`) it replaces an older link with the same fingerprint only when HELLO's `node` matches, as seven does. `agent.js` is a fake agent behind the page's `agent` cap: the tests queue scripted runs, emit transcript events, hold and release a run, reset watch streams, and turn the cap off. Loaded with `?kernel`, the test page lists `kernel-in` and answers `kernel` OPENs with `kernel.js`, a small HTTP and WebSocket echo server in the page.
1022
1024
 
1023
1025
  ### Kernel services
1024
1026
 
@@ -2010,7 +2012,7 @@ On a [§1.3](#13-local-setup-without-cdp-loopback-signalling) loopback link, `un
2010
2012
  - **Workers:** a touched dedicated, shared or service worker gets a guard session too (Network only, to see its imports' redirect chains), and its commands wait for it the same way, except `Runtime.runIfWaitingForDebugger` on a shared or service worker, which goes ahead so the worker can't stall on its own guard; its imports from before the guard was ready then count as unseen and can't be read. A worker script other than the worker's own whose chain that guard didn't see, or which touched a protected URL, can't be read. In pages, scripts and stylesheets loaded before the node attached are a known residual.
2011
2013
  - **CDP command ids:** ids at or above `0x70000000` (1879048192) belong to the CLI and are refused from clients. `0x40000000` (2^30) through `0x6FFFFFFF` is reserved for seven's (bios) guard; other clients use ids below 2^30.
2012
2014
  - **Waiting for that guard:** page commands on a touched target's session wait while the node sets its guard up there. The wait fails closed after 30 s without progress (an answer or event on that target's own guard session, or the answer to the node's attach to it; answers and events elsewhere on the stream don't count) or 5 min in all, whichever comes first, and the refusal names the bound. At most 4096 commands or 64 MiB wait on a stream; more is `RESET ENOBUFS`.
2013
- - **Sessions the node doesn't know:** a page command whose `sessionId` the node hasn't seen on this stream (in a `Target.attachedToTarget`, in the answer to the page's `Target.attachToTarget` or `Target.attachToBrowserTarget`, or its own) is held, not forwarded, until the session appears, and is then decided as usual. Only messages on that session id count as progress. The same bounds and caps apply, and the refusal is `slicc: refused: slicc doesn't know which target this session belongs to: …`, naming the bound. A session that detached is refused at once, without the suffix. Commands without a `sessionId` are unaffected.
2015
+ - **Sessions the node doesn't know:** a page command whose `sessionId` the node hasn't seen on this stream (in a `Target.attachedToTarget`, in the answer to the page's `Target.attachToTarget` or `Target.attachToBrowserTarget`, or its own) is held, not forwarded, until the session appears, and is then decided as usual. Only messages on that session id count as progress. The idle bound is 3 s (or the setup's, if shorter), on the session's own deadline; the outer bound and the caps are the setup's. A command on a session that never appears, that detached, or that the node still holds is never forwarded and gets Chrome's own `{"code":-32001,"message":"Session with given id not found."}`, at once unless the session never appeared. When the browser detaches a session, the node also removes every session under it, sends the page one `Target.detachedFromTarget` per removed session it was shown (children first, each on its parent session), answers their unanswered commands with the same error, and drops the browser's own later detach for them. Commands without a `sessionId` are unaffected.
2014
2016
  - **Auto-attached targets with no URL yet** (OOPIFs, popups) are held until the URL is known, then detached if protected. After 10 s with no URL they are treated as protected. The node's own setup connection ([§1.1](#11-local-setup-over-cdp)) isn't a `cdp` stream and is the one exception. [`cdp` (browser control)](#cdp-browser-control) has the details.
2015
2017
  - **Protection follows the target's own effective origin. Execution contexts on a protected origin are hidden, not cut,** unless the context is the target's own main-frame default context; that one still cuts the target as above. The typical case is an extension's content-script isolated world (`chrome-extension://<id>`) on an ordinary page. The page stays usable, and the hidden world is invisible and out of reach. A content-script isolated world of an extension on an ordinary page never counts as a child frame of that page and never protects its iframes; only a real `chrome-extension:` child frame (an iframe element or an `extension_frame` target) locks the tab (#651/#661). A page that also holds a protected frame (below) loses the frame-scoped and rendering commands listed there.
2016
2018
  - **Hidden:** the node learns every context of a touched target on its own guard session, whatever the page enabled. It drops the world's `Runtime.executionContextCreated` and `executionContextDestroyed`, its `consoleAPICalled`, `exceptionThrown` and `bindingCalled`. Debugger events follow the Stage 1 publication gate below; a pause in a hidden world resumes privately and publishes nothing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc",
3
- "version": "1.68.3",
3
+ "version": "1.68.5",
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.68.3",
22
- "@ai-ecoverse/slicc-darwin-amd64": "1.68.3",
23
- "@ai-ecoverse/slicc-linux-arm64": "1.68.3",
24
- "@ai-ecoverse/slicc-linux-amd64": "1.68.3",
25
- "@ai-ecoverse/slicc-windows-arm64": "1.68.3",
26
- "@ai-ecoverse/slicc-windows-amd64": "1.68.3",
21
+ "@ai-ecoverse/slicc-darwin-arm64": "1.68.5",
22
+ "@ai-ecoverse/slicc-darwin-amd64": "1.68.5",
23
+ "@ai-ecoverse/slicc-linux-arm64": "1.68.5",
24
+ "@ai-ecoverse/slicc-linux-amd64": "1.68.5",
25
+ "@ai-ecoverse/slicc-windows-arm64": "1.68.5",
26
+ "@ai-ecoverse/slicc-windows-amd64": "1.68.5",
27
27
  "@ai-ecoverse/slicc-jerk": "^1.9.1"
28
28
  }
29
29
  }