@ai-ecoverse/slicc-browsers 1.3.0 → 1.4.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.
package/README.md CHANGED
@@ -89,7 +89,7 @@ Every feature builds for `wasm32-wasip1`.
89
89
  - `discardExceptions`: where the site pattern and the extra origins' hosts go, as a `list` of strings or as a `chrome-time-map`, a map from site to the time it was added (microseconds since 1601-01-01 UTC, as a decimal string);
90
90
  - `cleanExit`: values that mark the last exit clean;
91
91
  - `form` says where a key comes from: `six` (SLICC six's keys) or `chrome-154` (what Chrome 154 reads).
92
- - `protectedOrigins`: what browser control must never reach, see [Protected origins](#protected-origins). `domains` (`sliccy.ai`), `schemes` (`https`, `http`), `innerSchemes` (`blob`, `filesystem`, `view-source`), `anySchemes` (`devtools`), `inheriting` (`about:blank`, `about:srcdoc`), and `refusal`, the text of a refusal.
92
+ - `protectedOrigins`: what browser control must never reach, see [Protected origins](#protected-origins). `domains` (`sliccy.ai`), `hosts` (`vault.sliccy.ai`), `schemes` (`https`, `http`), `innerSchemes` (`blob`, `filesystem`, `view-source`), `anySchemes` (`devtools`), `inheriting` (`about:blank`, `about:srcdoc`), and `refusal`, the text of a refusal.
93
93
  - `profiles`: SLICC profiles live in `<config dir>/<root>/<name>`, and a snap's in `~/snap/<snap>/common/<snapRoot>/<name>`. `legacyRoot` is the old root, never scanned; on macOS's case-insensitive volume it is SLICC six's root too. `sixProfilePattern` matches six's profile names, case-insensitively. `namePattern` is a valid profile name. `six` describes SLICC six's Chrome profiles (see [SLICC six's profiles](#slicc-sixs-profiles)):
94
94
  - `roots`: six's profile root per OS (`macos`, `linux`, `windows`), a `base` location followed by the `path` segments. The base is its `env` when that is set and not empty (any value, as six takes it), else `home` under the home dir.
95
95
  - `defaultName` (`browser-coding-agent-chrome`), `defaultPort` (5710) and `portSuffix` (`-{port}`): six's profile for its serve port `<port>` is `<root>/<defaultName>`, with `portSuffix` added for any port other than `defaultPort`.
@@ -104,16 +104,18 @@ Browser control must never navigate to, open or attach to a target on seven's ow
104
104
  **URLs.** A URL is parsed the way the WHATWG URL Standard (and so the browser) parses it, so `https:\\seven.sliccy.ai`, a tab or newline inside the URL, `%2E`, `。` and full-width letters all reach seven. In Go and Rust that takes a WHATWG parser, not `net/url`. A URL that doesn't parse isn't protected; the browser doesn't load it either. Then:
105
105
  1. While its scheme is one of `innerSchemes`, the rest of the URL after `<scheme>:` takes its place, at most 8 times: `blob:https://seven.sliccy.ai/<uuid>` is `https://seven.sliccy.ai/<uuid>`.
106
106
  2. A scheme in `anySchemes` is protected whatever follows: a DevTools front end (`devtools://`) can be inspecting seven.
107
- 3. A scheme in `schemes` is protected when its host is one of `domains` or under one, at any depth and on any port. The host is lower-cased, and one trailing dot is dropped.
107
+ 3. A scheme in `schemes` is protected when its host is one of `hosts`, or one of `domains` or under one, at any depth and on any port. The host is lower-cased, and one trailing dot is dropped.
108
108
  4. Any other URL is protected when its origin is one of the program's **extra origins**: the seven origins it accepts besides `sliccy.ai` (slicc-cli's `--origin` and `--page` origins), compared as `scheme://host[:port]` without the scheme's default port, with the host as in 3.
109
109
 
110
110
  This is wider than the rule for finding seven (`seven.originHostPattern`, which leaves out `www`). Every `sliccy.ai` host shares the `sliccy.ai` cookies, and cookies ignore the port and, without `Secure`, the scheme. SLICC six lives on `www.sliccy.ai` and the apex, and its cookies matter. `*.kernel.localhost` is not protected: each port is its own origin, and the agent's own servers live there. An extra origin is matched exactly, so `http://127.0.0.1:5710` doesn't protect `http://127.0.0.1:5711`.
111
111
 
112
+ **The vault.** `vault.sliccy.ai` is in `hosts` by name. `sliccy.ai` already covers it, but it must stay protected even if `domains` ever changes: the vault must never be a CDP target for agent tools. The one exception is slicc-cli's own pairing attach for the vault, which is the CLI's own connection and not browser control handed to the agent.
113
+
112
114
  **Targets.** A target's effective origin is its URL's (`TargetInfo.url`), except when the URL inherits the origin of whoever made the document: the empty URL, and `inheriting` with any query or fragment. Such a target is protected when it was protected before this URL (a seven tab that went to `about:blank` keeps seven's origin), or when its opener (`openerId`, else `openerFrameId`) is protected or unknown, for an opener closed before the program saw it. The URL, `openerFrameId` and `browserContextId` alone can't tell: a blank popup that seven opens has seven's origin and the URL `about:blank`. A program that holds a session to the target also has the document's real origin: the main frame's `securityOrigin` in `Page.frameNavigated`, and the default context's `origin` in `Runtime.executionContextCreated`. When one of those is protected, the target is protected too, until a URL with an origin of its own replaces it.
113
115
 
114
116
  A same-site frame shares its parent's process and has no target of its own. Every `sliccy.ai` host is protected, and site isolation gives a seven frame inside any other site its own target, so this only matters for an extra origin whose site has other origins (another port of `127.0.0.1`, say).
115
117
 
116
- **Cookies.** A cookie domain, lower-cased and without a leading or trailing dot, is protected when it is one of `domains` or under one, or when it is the host of a protected domain or an extra origin, or a parent of one: a cookie on `.example.test` reaches `https://seven.example.test`.
118
+ **Cookies.** A cookie domain, lower-cased and without a leading or trailing dot, is protected when it is one of `domains` or under one, or when it is one of `hosts`, the host of a protected domain or an extra origin, or a parent of one: a cookie on `.example.test` reaches `https://seven.example.test`.
117
119
 
118
120
  **Storage keys** (`Storage`, `IndexedDB`, `CacheStorage` and `FileSystem` in CDP): a key is protected when its origin (up to the first `^`) or its top-level site (a part after `^0`) is a protected URL.
119
121
 
package/catalog.json CHANGED
@@ -703,6 +703,7 @@
703
703
  },
704
704
  "protectedOrigins": {
705
705
  "domains": ["sliccy.ai"],
706
+ "hosts": ["vault.sliccy.ai"],
706
707
  "schemes": ["https", "http"],
707
708
  "innerSchemes": ["blob", "filesystem", "view-source"],
708
709
  "anySchemes": ["devtools"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/protected.json CHANGED
@@ -11,6 +11,12 @@
11
11
  { "url": "http://seven.sliccy.ai/", "protected": true },
12
12
  { "url": "https://main--seven.sliccy.ai/", "protected": true },
13
13
  { "url": "https://www.sliccy.ai/", "protected": true },
14
+ { "url": "https://vault.sliccy.ai/", "protected": true },
15
+ { "url": "https://VAULT.sliccy.ai:443/unlock?x=1", "protected": true },
16
+ { "url": "http://vault.sliccy.ai./", "protected": true },
17
+ { "url": "blob:https://vault.sliccy.ai/0b9e0f6c", "protected": true },
18
+ { "url": "https://vault.sliccy.ai.example/", "protected": false },
19
+ { "url": "https://vault-sliccy.ai/", "protected": false },
14
20
  { "url": "https://sliccy.ai/", "protected": true },
15
21
  { "url": "https://a.b.sliccy.ai/", "protected": true },
16
22
  { "url": "https://seven.sliccy.ai./", "protected": true },
@@ -82,6 +88,8 @@
82
88
  ],
83
89
  "targets": [
84
90
  { "url": "https://seven.sliccy.ai/", "protected": true },
91
+ { "url": "https://vault.sliccy.ai/", "protected": true },
92
+ { "url": "about:blank", "opener": "protected", "protected": true },
85
93
  { "url": "https://example.com/", "protected": false },
86
94
  { "url": "https://example.com/", "previous": true, "protected": false },
87
95
  { "url": "https://example.com/", "opener": "protected", "protected": false },
@@ -108,6 +116,7 @@
108
116
  { "domain": "sliccy.ai", "protected": true },
109
117
  { "domain": ".sliccy.ai", "protected": true },
110
118
  { "domain": "seven.sliccy.ai", "protected": true },
119
+ { "domain": "vault.sliccy.ai", "protected": true },
111
120
  { "domain": ".www.sliccy.ai", "protected": true },
112
121
  { "domain": "SLICCY.AI", "protected": true },
113
122
  { "domain": "sliccy.ai.", "protected": true },
@@ -128,6 +137,7 @@
128
137
  "storageKeys": [
129
138
  { "key": "https://seven.sliccy.ai/", "protected": true },
130
139
  { "key": "https://sliccy.ai/", "protected": true },
140
+ { "key": "https://vault.sliccy.ai/", "protected": true },
131
141
  { "key": "http://127.0.0.1:5710/", "protected": true },
132
142
  { "key": "https://widget.example/^0https://sliccy.ai", "protected": true },
133
143
  { "key": "https://seven.sliccy.ai/^31", "protected": true },
package/protected.mjs CHANGED
@@ -39,6 +39,7 @@ export function protectedOrigins(rules, extraOrigins = []) {
39
39
  if (!u) return false;
40
40
  const s = scheme(u);
41
41
  if (rules.anySchemes.includes(s)) return true;
42
+ if (rules.schemes.includes(s) && rules.hosts.includes(hostOf(u))) return true;
42
43
  if (rules.schemes.includes(s) && rules.domains.some((d) => under(hostOf(u), d))) return true;
43
44
  const o = originOf(u);
44
45
  return o !== null && extra.includes(o);
@@ -65,7 +66,7 @@ export function protectedOrigins(rules, extraOrigins = []) {
65
66
  if (d.endsWith('.')) d = d.slice(0, -1);
66
67
  if (d === '') return false;
67
68
  if (rules.domains.some((x) => under(d, x))) return true;
68
- return [...rules.domains, ...extraHosts].some((h) => under(h, d));
69
+ return [...rules.domains, ...rules.hosts, ...extraHosts].some((h) => under(h, d));
69
70
  };
70
71
 
71
72
  const storageKey = (key) => {
@@ -173,7 +173,15 @@
173
173
  "protectedOrigins": {
174
174
  "type": "object",
175
175
  "additionalProperties": false,
176
- "required": ["domains", "schemes", "innerSchemes", "anySchemes", "inheriting", "refusal"],
176
+ "required": [
177
+ "domains",
178
+ "hosts",
179
+ "schemes",
180
+ "innerSchemes",
181
+ "anySchemes",
182
+ "inheriting",
183
+ "refusal"
184
+ ],
177
185
  "properties": {
178
186
  "domains": {
179
187
  "type": "array",
@@ -184,6 +192,14 @@
184
192
  "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
185
193
  }
186
194
  },
195
+ "hosts": {
196
+ "type": "array",
197
+ "uniqueItems": true,
198
+ "items": {
199
+ "type": "string",
200
+ "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
201
+ }
202
+ },
187
203
  "schemes": { "$ref": "#/$defs/schemes", "type": "array", "minItems": 1 },
188
204
  "innerSchemes": { "$ref": "#/$defs/schemes" },
189
205
  "anySchemes": { "$ref": "#/$defs/schemes" },