@xkwdstore/agent 2.1.5 → 2.1.6

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/CHANGELOG.md CHANGED
@@ -1,130 +1,163 @@
1
- # Changelog — @xkwdstore/agent
2
-
3
- ## 2.1.5 — browser connectivity, capability-based proxy health, Chrome Web Store support
4
-
5
- ### Fixed
6
- - **Indefinite `about:blank` on a stalled navigation.** A proxy that accepts TCP
7
- but never answers `CONNECT` left Chromium pending forever: the tab stayed on
8
- `about:blank` with a loading indicator, the caller's timeout was the only stop,
9
- and several call sites discarded that error. Every context now gets a bounded
10
- navigation timeout and a stall guard that watches the **main-frame document
11
- request through CDP** (`Network.requestWillBeSent` / `responseReceived` /
12
- `loadingFinished` / `loadingFailed`), so:
13
- - a page that merely streams its body slowly is never interrupted (headers
14
- received = progress; redirects reset the budget);
15
- - downloads and cancelled navigations are ignored;
16
- - a genuinely stalled document is replaced, after the stall budget, by a
17
- script-free diagnostic page with the typed failure code, target host, session,
18
- stage/reason, a **retry link** and explicit statements that the profile,
19
- cookies and extensions were untouched and the proxy was not bypassed;
20
- - a successful commit resets the guard, so a later stall is still caught.
21
- - **Failed navigations now carry a typed, actionable code** on the direct and
22
- machine-worker runtimes (`NAVIGATION_TIMEOUT`, `PROXY_TUNNEL_FAILED`,
23
- `NAVIGATION_DNS_FAILED`, `TLS_CERTIFICATE_ERROR`, `ORIGIN_HTTP_ERROR`,
24
- `ORIGIN_INVALID_RESPONSE`, `NETWORK_UNAVAILABLE`, `NAVIGATION_UNREACHABLE`,
25
- `NAVIGATION_ABORTED`, `NAVIGATION_BLOCKED`, `NAVIGATION_STALLED`). Startup
26
- verification paints the diagnostic page when the startup navigation failed.
27
- - **Proxy validation is capability-based, not a single-endpoint ping.**
28
- `api.ipify.org` answering no longer means "healthy". Every managed destination
29
- is probed through the proxy (DNS/TCP/TLS/HTTP, HTTP CONNECT or SOCKS5):
30
- Google Search, Chrome Web Store, Google accounts, gstatic, clients2,
31
- `update.googleapis.com`, example.com, x.com, api.ipify.org. States:
32
- `HEALTHY`, `DEGRADED`, `AUTHENTICATION_FAILED`, `CONNECT_TIMEOUT`, `DNS_FAILED`,
33
- `TLS_FAILED`, `DESTINATION_UNREACHABLE`, `DESTINATION_RESTRICTED`,
34
- `CONNECTION_REFUSED`, `UNREACHABLE`, `UNKNOWN`.
35
- `DESTINATION_RESTRICTED` is reported with evidence: the proxy must carry a
36
- baseline destination while a required destination is denied or refused.
37
- Results are cached for 60 s and rate limited per proxy endpoint (2/min) and per
38
- account at the API (6/min) to protect proxy bandwidth. No automatic failover
39
- and no direct fallback.
40
- - **Device authentication retry storm (2.1.5, phase 4).** A revoked or replaced
41
- device was retried forever at the 60 s backoff cap: the production broker log
42
- accumulated **43,576** `Device authentication failed` lines over ~7 weeks.
43
- Authentication is now a permanent failure class: at most **3** consecutive
44
- attempts with exponential backoff, then retries stop, a single actionable
45
- message is written, and the state is exposed as **reauthorization required**
46
- (`status`/`doctor` + `runtime/broker-health.json`). The device key and metadata
47
- are **never** deleted on 4003; only explicit `logout`/`revoke-local` removes
48
- them.
49
- - **Device recovery without losing profiles (2.1.5, phase 4).** The backend now
50
- advertises `device-recovery-v1`; `xkwd-agent recover` re-authorizes the
51
- **same deviceId** with the existing key after owner approval. This preserves
52
- device-bound browser profiles (cookies/sessions) instead of minting a new
53
- device id, which would quarantine them. Recovery is allowed only for a device
54
- revoked by the normal single-device replacement, never for an owner/security
55
- revocation, and the dashboard warns that approving it revokes the currently
56
- active device (the tenant permits one active protocol-v2 device per user).
57
- The deployed backend does not advertise the capability yet, so the CLI refuses
58
- rather than silently creating a new identity.
59
- - **Silent tunnel drops** are detected and distinguished from timeouts.
60
- - **IPv4/IPv6** capability of the proxy host is reported (resolution + TCP per
61
- family), and the protocol is validated (`http`, `https`, `socks5`, `socks5h`,
62
- `socks4`).
63
- - **Atomic JSON writes failed on Windows** with `EPERM: fsync` because the live
64
- file was opened read-only before `fsync`. Windows `FlushFileBuffers` requires a
65
- writable handle; the live file is now opened `r+` (with a read-only fallback on
66
- POSIX). This was a real cross-platform defect, not an environmental one, and it
67
- caused 16 backend test failures on Windows.
68
-
69
- ### Added
70
- - `src/browserConnectivity.js` — classification, bounded navigation, CDP stall
71
- guard, public-endpoint probes (HTTP CONNECT + SOCKS5), diagnostic page, NetLog
72
- sanitization.
73
- - `src/proxyCapability.js` — capability-based proxy health (per-destination
74
- matrix, overall state, cache, rate limit, IP families, protocol check).
75
- - `src/browserLaunch.js` — one shared Chromium launch-options builder used by the
76
- machine worker, the broker/direct runtime and the legacy runtime. Drops
77
- Playwright's `--disable-extensions` for branded Chrome/Edge and reports
78
- `unpackedExtensionLoading: false` (branded Chrome ≥137 ignores
79
- `--load-extension` — verified on Chrome 157.0.8103.80 and 158.0.8127.38: `extension_service.cc` logs
80
- "not allowed in Google Chrome, ignoring").
81
- - Typed read-only command `connectivity-test` (lease-optional, SSRF-limited to the
82
- documented endpoint allowlist) and backend route
83
- `POST /api/proxy/account/:accountId/connectivity`, plus per-destination results
84
- in the proxy management UI (`ProxyConnectivityPanel`).
85
- - `scripts/browser-connectivity-diag.js` — operator CLI: direct or through-proxy
86
- capability matrix, optional explicit direct comparison, optional sanitized
87
- NetLog capture.
88
- - NetLog handling: capture remains **opt-in** (`XKWDSTORE_NETLOG_DIR`); files are
89
- sanitized in place (header blocks dropped, credential keys redacted, URL
90
- query/fragment/userinfo stripped). No raw copy remains.
91
- - `getStatus` now reports `pageStalled`, the browser family/capabilities and the
92
- navigation-guard state.
93
-
94
- ### Verified
95
- - Re-verified on Chrome 158.0.8127.38 (2026-11-24): Web Store home/search/live
96
- detail render, the live item exposes a real "Add to Chrome" control, the
97
- navigation guard contains stalls and recovers through retry, and branded
98
- Chrome still refuses unpacked extension loading (0 service workers; its own
99
- log: `--disable-extensions-except is not allowed in Google Chrome, ignoring.`).
100
- - Real managed Chrome 157 + a preserved production profile load all Google
101
- endpoints and X (200).
102
- - A controlled proxy that permits X/example.com but denies every Google host is
103
- reported `DESTINATION_RESTRICTED` (Google 0/6, X healthy) and the browser shows
104
- `PROXY_TUNNEL_FAILED` instead of a blank tab.
105
- - A black-holed proxy is reported `CONNECT_TIMEOUT`; missing credentials
106
- `AUTHENTICATION_FAILED`; a dead port `CONNECTION_REFUSED`.
107
- - Slow body transfer is not interrupted; a stalled navigation is contained and
108
- the retry link resumes browsing.
109
- - Chrome Web Store: live item pages render with "Add to Chrome"; installation is
110
- gated by Chrome's native consent dialog (human confirmation, not automatable).
111
-
112
- ### Known limitations
113
- - Branded Google Chrome ignores `--load-extension`, so unpacked extension loading
114
- requires Chromium/Chrome-for-Testing (or a Web Store install with human
115
- confirmation). No feature assumes otherwise.
116
- - A very slow **first byte** beyond the stall budget (default 30 s) is treated as
117
- a stall by design; tune `XKWDSTORE_NAV_STALL_TIMEOUT_MS`.
118
- - One active protocol-v2 device per user. Approving a new device (or recovering
119
- this one) revokes the currently active device by design; the dashboard now
120
- warns before approval. Recovery preserves the recovered device's profiles, but
121
- the displaced device stops connecting until it is recovered in turn.
122
- - `xkwd-agent recover` requires a backend that advertises `device-recovery-v1`;
123
- against the currently deployed backend it refuses instead of creating a new
124
- device id.
125
-
126
- ## 2.1.4 — machine-wide hardening (published)
127
-
128
- Profile ACL generation that keeps the interactive session user able to launch
129
- Chromium, packaging completeness, broker/worker lifecycle and the X session
130
- restoration pipeline. See `reports/` for the authoritative publication state.
1
+ # Changelog — @xkwdstore/agent
2
+
3
+ ## 2.1.6 — authenticated proxies load Google properties (HTTP/1.1 pin)
4
+
5
+ ### Fixed
6
+ - **Google properties stalled forever through an authenticated proxy.** With a
7
+ credential-bearing HTTP CONNECT proxy, Chromium's HTTP/2 request path never
8
+ completed a document to Google: the tunnel answered `200`, TLS 1.3 negotiated
9
+ with ALPN `h2`, the certificate validated — and then the main-frame stream was
10
+ opened and no `HEADERS`/`DATA` ever arrived. The tab stayed on `about:blank`
11
+ until the caller's timeout, so Google Search, Chrome Web Store, Google accounts,
12
+ gstatic, clients2 and `update.googleapis.com` were unreachable while `x.com`,
13
+ `example.com` and `api.ipify.org` loaded normally through the same proxy.
14
+ Verified against production proxies: 0/6 Google destinations over h2, 6/6 with
15
+ HTTP/1.1; identical on system Chrome 158 and Playwright's bundled Chromium,
16
+ with `--disable-quic`, with EncryptedClientHello/Alps disabled, after a warm
17
+ 407 challenge, and on every proxy tested. The same proxies carry a complete
18
+ Google h2 response (200, 91,721 bytes) to a Node `http2` client, so the defect
19
+ is in Chromium's h2-over-authenticated-proxy negotiation, not the network.
20
+ **Fix:** `buildLaunchArgs` now emits `--disable-http2` for a proxy-required
21
+ session **only when the proxy carries credentials**, in all three runtimes
22
+ (machine worker, broker session handler, legacy CLI). This changes no security
23
+ control: TLS/certificate validation, certificate pinning, DNS pinning
24
+ (`--host-resolver-rules`), QUIC suppression, WebRTC non-proxied-UDP suppression
25
+ and proxy routing are all unchanged, and there is still no direct fallback.
26
+ HTTP/2 is preserved for direct sessions and for proxies that accept CONNECT
27
+ without credentials. End-to-end through the production proxy with the
28
+ production launch args: Google, Chrome Web Store and X all `200`, cookies and
29
+ localStorage survive a full browser restart, and a second profile shares
30
+ nothing.
31
+
32
+ ### Notes
33
+ - 2.1.5 is superseded: it shipped the HTTP/2 path, so managed sessions bound to
34
+ a credential-bearing proxy could not open Google. Nothing else in 2.1.5
35
+ changes.
36
+ ## 2.1.5 — browser connectivity, capability-based proxy health, Chrome Web Store support
37
+
38
+ ### Fixed
39
+ - **Indefinite `about:blank` on a stalled navigation.** A proxy that accepts TCP
40
+ but never answers `CONNECT` left Chromium pending forever: the tab stayed on
41
+ `about:blank` with a loading indicator, the caller's timeout was the only stop,
42
+ and several call sites discarded that error. Every context now gets a bounded
43
+ navigation timeout and a stall guard that watches the **main-frame document
44
+ request through CDP** (`Network.requestWillBeSent` / `responseReceived` /
45
+ `loadingFinished` / `loadingFailed`), so:
46
+ - a page that merely streams its body slowly is never interrupted (headers
47
+ received = progress; redirects reset the budget);
48
+ - downloads and cancelled navigations are ignored;
49
+ - a genuinely stalled document is replaced, after the stall budget, by a
50
+ script-free diagnostic page with the typed failure code, target host, session,
51
+ stage/reason, a **retry link** and explicit statements that the profile,
52
+ cookies and extensions were untouched and the proxy was not bypassed;
53
+ - a successful commit resets the guard, so a later stall is still caught.
54
+ - **Failed navigations now carry a typed, actionable code** on the direct and
55
+ machine-worker runtimes (`NAVIGATION_TIMEOUT`, `PROXY_TUNNEL_FAILED`,
56
+ `NAVIGATION_DNS_FAILED`, `TLS_CERTIFICATE_ERROR`, `ORIGIN_HTTP_ERROR`,
57
+ `ORIGIN_INVALID_RESPONSE`, `NETWORK_UNAVAILABLE`, `NAVIGATION_UNREACHABLE`,
58
+ `NAVIGATION_ABORTED`, `NAVIGATION_BLOCKED`, `NAVIGATION_STALLED`). Startup
59
+ verification paints the diagnostic page when the startup navigation failed.
60
+ - **Proxy validation is capability-based, not a single-endpoint ping.**
61
+ `api.ipify.org` answering no longer means "healthy". Every managed destination
62
+ is probed through the proxy (DNS/TCP/TLS/HTTP, HTTP CONNECT or SOCKS5):
63
+ Google Search, Chrome Web Store, Google accounts, gstatic, clients2,
64
+ `update.googleapis.com`, example.com, x.com, api.ipify.org. States:
65
+ `HEALTHY`, `DEGRADED`, `AUTHENTICATION_FAILED`, `CONNECT_TIMEOUT`, `DNS_FAILED`,
66
+ `TLS_FAILED`, `DESTINATION_UNREACHABLE`, `DESTINATION_RESTRICTED`,
67
+ `CONNECTION_REFUSED`, `UNREACHABLE`, `UNKNOWN`.
68
+ `DESTINATION_RESTRICTED` is reported with evidence: the proxy must carry a
69
+ baseline destination while a required destination is denied or refused.
70
+ Results are cached for 60 s and rate limited per proxy endpoint (2/min) and per
71
+ account at the API (6/min) to protect proxy bandwidth. No automatic failover
72
+ and no direct fallback.
73
+ - **Device authentication retry storm (2.1.5, phase 4).** A revoked or replaced
74
+ device was retried forever at the 60 s backoff cap: the production broker log
75
+ accumulated **43,576** `Device authentication failed` lines over ~7 weeks.
76
+ Authentication is now a permanent failure class: at most **3** consecutive
77
+ attempts with exponential backoff, then retries stop, a single actionable
78
+ message is written, and the state is exposed as **reauthorization required**
79
+ (`status`/`doctor` + `runtime/broker-health.json`). The device key and metadata
80
+ are **never** deleted on 4003; only explicit `logout`/`revoke-local` removes
81
+ them.
82
+ - **Device recovery without losing profiles (2.1.5, phase 4).** The backend now
83
+ advertises `device-recovery-v1`; `xkwd-agent recover` re-authorizes the
84
+ **same deviceId** with the existing key after owner approval. This preserves
85
+ device-bound browser profiles (cookies/sessions) instead of minting a new
86
+ device id, which would quarantine them. Recovery is allowed only for a device
87
+ revoked by the normal single-device replacement, never for an owner/security
88
+ revocation, and the dashboard warns that approving it revokes the currently
89
+ active device (the tenant permits one active protocol-v2 device per user).
90
+ The deployed backend does not advertise the capability yet, so the CLI refuses
91
+ rather than silently creating a new identity.
92
+ - **Silent tunnel drops** are detected and distinguished from timeouts.
93
+ - **IPv4/IPv6** capability of the proxy host is reported (resolution + TCP per
94
+ family), and the protocol is validated (`http`, `https`, `socks5`, `socks5h`,
95
+ `socks4`).
96
+ - **Atomic JSON writes failed on Windows** with `EPERM: fsync` because the live
97
+ file was opened read-only before `fsync`. Windows `FlushFileBuffers` requires a
98
+ writable handle; the live file is now opened `r+` (with a read-only fallback on
99
+ POSIX). This was a real cross-platform defect, not an environmental one, and it
100
+ caused 16 backend test failures on Windows.
101
+
102
+ ### Added
103
+ - `src/browserConnectivity.js` — classification, bounded navigation, CDP stall
104
+ guard, public-endpoint probes (HTTP CONNECT + SOCKS5), diagnostic page, NetLog
105
+ sanitization.
106
+ - `src/proxyCapability.js` — capability-based proxy health (per-destination
107
+ matrix, overall state, cache, rate limit, IP families, protocol check).
108
+ - `src/browserLaunch.js` — one shared Chromium launch-options builder used by the
109
+ machine worker, the broker/direct runtime and the legacy runtime. Drops
110
+ Playwright's `--disable-extensions` for branded Chrome/Edge and reports
111
+ `unpackedExtensionLoading: false` (branded Chrome ≥137 ignores
112
+ `--load-extension` — verified on Chrome 157.0.8103.80 and 158.0.8127.38: `extension_service.cc` logs
113
+ "not allowed in Google Chrome, ignoring").
114
+ - Typed read-only command `connectivity-test` (lease-optional, SSRF-limited to the
115
+ documented endpoint allowlist) and backend route
116
+ `POST /api/proxy/account/:accountId/connectivity`, plus per-destination results
117
+ in the proxy management UI (`ProxyConnectivityPanel`).
118
+ - `scripts/browser-connectivity-diag.js` — operator CLI: direct or through-proxy
119
+ capability matrix, optional explicit direct comparison, optional sanitized
120
+ NetLog capture.
121
+ - NetLog handling: capture remains **opt-in** (`XKWDSTORE_NETLOG_DIR`); files are
122
+ sanitized in place (header blocks dropped, credential keys redacted, URL
123
+ query/fragment/userinfo stripped). No raw copy remains.
124
+ - `getStatus` now reports `pageStalled`, the browser family/capabilities and the
125
+ navigation-guard state.
126
+
127
+ ### Verified
128
+ - Re-verified on Chrome 158.0.8127.38 (2026-11-24): Web Store home/search/live
129
+ detail render, the live item exposes a real "Add to Chrome" control, the
130
+ navigation guard contains stalls and recovers through retry, and branded
131
+ Chrome still refuses unpacked extension loading (0 service workers; its own
132
+ log: `--disable-extensions-except is not allowed in Google Chrome, ignoring.`).
133
+ - Real managed Chrome 157 + a preserved production profile load all Google
134
+ endpoints and X (200).
135
+ - A controlled proxy that permits X/example.com but denies every Google host is
136
+ reported `DESTINATION_RESTRICTED` (Google 0/6, X healthy) and the browser shows
137
+ `PROXY_TUNNEL_FAILED` instead of a blank tab.
138
+ - A black-holed proxy is reported `CONNECT_TIMEOUT`; missing credentials
139
+ `AUTHENTICATION_FAILED`; a dead port `CONNECTION_REFUSED`.
140
+ - Slow body transfer is not interrupted; a stalled navigation is contained and
141
+ the retry link resumes browsing.
142
+ - Chrome Web Store: live item pages render with "Add to Chrome"; installation is
143
+ gated by Chrome's native consent dialog (human confirmation, not automatable).
144
+
145
+ ### Known limitations
146
+ - Branded Google Chrome ignores `--load-extension`, so unpacked extension loading
147
+ requires Chromium/Chrome-for-Testing (or a Web Store install with human
148
+ confirmation). No feature assumes otherwise.
149
+ - A very slow **first byte** beyond the stall budget (default 30 s) is treated as
150
+ a stall by design; tune `XKWDSTORE_NAV_STALL_TIMEOUT_MS`.
151
+ - One active protocol-v2 device per user. Approving a new device (or recovering
152
+ this one) revokes the currently active device by design; the dashboard now
153
+ warns before approval. Recovery preserves the recovered device's profiles, but
154
+ the displaced device stops connecting until it is recovered in turn.
155
+ - `xkwd-agent recover` requires a backend that advertises `device-recovery-v1`;
156
+ against the currently deployed backend it refuses instead of creating a new
157
+ device id.
158
+
159
+ ## 2.1.4 — machine-wide hardening (published)
160
+
161
+ Profile ACL generation that keeps the interactive session user able to launch
162
+ Chromium, packaging completeness, broker/worker lifecycle and the X session
163
+ restoration pipeline. See `reports/` for the authoritative publication state.