@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 +163 -130
- package/README.md +281 -280
- package/package.json +43 -43
- package/scripts/install-machine-agent.ps1 +385 -385
- package/src/brokerConnectionSupervisor.js +319 -319
- package/src/brokerHealth.js +113 -113
- package/src/brokerWorkerBridge.js +377 -377
- package/src/browserConnectivity.js +1461 -1461
- package/src/browserIsolation.js +26 -1
- package/src/browserLaunch.js +136 -136
- package/src/cli.js +1290 -1290
- package/src/cookieInjection.js +255 -255
- package/src/index.js +7 -0
- package/src/proxyCapability.js +481 -481
- package/src/sessionAuth.js +439 -439
- package/src/sessionHandler.js +3 -0
- package/src/worker.js +707 -703
package/CHANGELOG.md
CHANGED
|
@@ -1,130 +1,163 @@
|
|
|
1
|
-
# Changelog — @xkwdstore/agent
|
|
2
|
-
|
|
3
|
-
## 2.1.
|
|
4
|
-
|
|
5
|
-
### Fixed
|
|
6
|
-
- **
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
machine
|
|
23
|
-
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
`
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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.
|