webhands 0.2.0 → 0.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 +69 -6
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +607 -9
- package/dist/cli.js.map +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +25 -2
- package/dist/errors.js.map +1 -1
- package/package.json +2 -2
- package/src/cli.ts +734 -9
- package/src/errors.ts +31 -0
package/README.md
CHANGED
|
@@ -83,13 +83,31 @@ This is a **personal-use** tool. Its whole premise is that you drive a browser
|
|
|
83
83
|
[`docs/adr/0002`](docs/adr/0002-real-session-over-fingerprint-spoofing.md)). It is
|
|
84
84
|
deliberately local and single-session by design.
|
|
85
85
|
|
|
86
|
-
- **No login-bypass, no CAPTCHA
|
|
87
|
-
clears any anti-bot challenge in the headed `setup-profile` step.
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
- **No login-bypass, no built-in CAPTCHA solver.** The human does the one-time
|
|
87
|
+
login and clears any anti-bot challenge in the headed `setup-profile` step.
|
|
88
|
+
webhands ships NO captcha solver and NO provider key, and does not bypass
|
|
89
|
+
authentication itself. What changed: the verb surface is now rich enough that it
|
|
90
|
+
no longer STANDS IN THE WAY of a capable agent that brings its OWN key. Such an
|
|
91
|
+
agent can get past a captcha by poking the page with verbs, both families: the
|
|
92
|
+
token-harvest family by reading the sitekey with a frame-aware `query`, `type`ing
|
|
93
|
+
a provider token into the response sink, and firing the callback; the vision/tile
|
|
94
|
+
family with the coordinate `mouse`, the element-clipped `screenshot`, and the
|
|
95
|
+
cross-origin frame read. We do not solve it; we no longer stand in the way. The
|
|
96
|
+
agent supplies its own key and its own logic (or uses a hand, below). webhands
|
|
97
|
+
is capable, not a solver.
|
|
98
|
+
- **Hands are the simpler path (still).** A *hand* is a third-party capability
|
|
99
|
+
module (`iamhuman` today, a future buy-on-amazon hand) that closes over the live
|
|
100
|
+
page and makes the hard thing ONE call. A dumb agent plus a hand still gets there
|
|
101
|
+
in a single call, even though a capable agent can now do the same over several
|
|
102
|
+
verb turns. The two paths coexist: the verb surface is the floor that makes the
|
|
103
|
+
unaided path POSSIBLE; a hand is the ramp that makes it EASY. (A hand is a
|
|
104
|
+
trusted in-process peer, loaded only when you name it in `hands.json`; see
|
|
105
|
+
[`docs/adr/0007`](docs/adr/0007-public-hand-contract-and-explicit-declarative-loading.md).)
|
|
90
106
|
- **No fingerprint-spoofing / anti-detect tricks.** It leans on being a *real*
|
|
91
|
-
browser/profile/IP rather than spoofing. There is no proxy rotation or
|
|
92
|
-
anti-detect build here.
|
|
107
|
+
browser/profile/IP rather than spoofing. There is no proxy *rotation* or
|
|
108
|
+
anti-detect build here. (A single, user-chosen SOCKS proxy for traffic/DNS
|
|
109
|
+
control is available opt-in via `--proxy`; see *Optional: route traffic and
|
|
110
|
+
DNS through a SOCKS proxy* below.)
|
|
93
111
|
- **Your own session only.** A replayed/stolen cookie does not work anyway
|
|
94
112
|
(clearance is bound to the browser fingerprint and IP, not just the cookie);
|
|
95
113
|
the design assumes the session is genuinely yours.
|
|
@@ -174,6 +192,51 @@ reputation still matter. The realistic recipe is stealth +
|
|
|
174
192
|
IP (see
|
|
175
193
|
[`docs/adr/0002`](docs/adr/0002-real-session-over-fingerprint-spoofing.md)).
|
|
176
194
|
|
|
195
|
+
## Optional: route traffic and DNS through a SOCKS proxy (opt-in, default OFF)
|
|
196
|
+
|
|
197
|
+
By default webhands connects directly on your own machine and IP. If you want
|
|
198
|
+
the browser to egress through a chosen SOCKS proxy (a VPN exit, an SSH/Tor SOCKS
|
|
199
|
+
endpoint, a residential proxy), pass `--proxy <socks-url>` to `serve` (or
|
|
200
|
+
`launch`). It routes **all** browser traffic AND DNS through that one proxy:
|
|
201
|
+
|
|
202
|
+
```sh
|
|
203
|
+
# socks5h:// tunnels DNS through the proxy too (no DNS leak):
|
|
204
|
+
npx webhands serve --headed --proxy socks5h://127.0.0.1:1080
|
|
205
|
+
|
|
206
|
+
# with credentials:
|
|
207
|
+
npx webhands serve --proxy socks5h://user:pass@host:1080
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
- **`socks5h://` means no DNS leak.** webhands adds Chromium's
|
|
211
|
+
`--host-resolver-rules` catch-all so even side channels (the DNS prefetcher)
|
|
212
|
+
cannot leak a raw local DNS query; only the proxy's own host is resolved
|
|
213
|
+
locally. This is the recommended form.
|
|
214
|
+
- **`socks5://` (or `socks://`) allows local DNS.** Use it when you deliberately
|
|
215
|
+
want split DNS. URL loads still resolve at the proxy, but Chromium may issue
|
|
216
|
+
some local DNS. Override either way with the programmatic `proxyNoLeak`
|
|
217
|
+
option.
|
|
218
|
+
- **A malformed `--proxy` value fails loudly** with a typed `InvalidProxyError`
|
|
219
|
+
(it never silently launches unproxied, which would leak the traffic you asked
|
|
220
|
+
to tunnel).
|
|
221
|
+
|
|
222
|
+
Programmatic equivalent:
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
import {PlaywrightLaunchTransport} from '@webhands/core';
|
|
226
|
+
|
|
227
|
+
const transport = new PlaywrightLaunchTransport(
|
|
228
|
+
{}, // profile location
|
|
229
|
+
[], // extra hands
|
|
230
|
+
{proxy: 'socks5h://127.0.0.1:1080'}, // all traffic + DNS via the proxy, no leak
|
|
231
|
+
);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Honest caveat.** A proxy changes your IP and DNS path; it does **not** by
|
|
235
|
+
itself defeat bot detection, and a proxy/VPN/datacenter IP often reads WORSE
|
|
236
|
+
than a clean residential one. This is a deliberate, scoped opt-in deviation from
|
|
237
|
+
the "own IP" default (see
|
|
238
|
+
[`docs/adr/0009`](docs/adr/0009-opt-in-socks-proxy-all-traffic-and-dns.md)).
|
|
239
|
+
|
|
177
240
|
## Security note (the `serve` endpoint runs arbitrary code)
|
|
178
241
|
|
|
179
242
|
The page verbs execute caller-supplied expressions: `eval` runs a JS expression
|
package/dist/cli.d.ts
CHANGED
|
@@ -80,6 +80,12 @@ export interface LaunchPolicy {
|
|
|
80
80
|
* to keep the fixed viewport even under stealth.
|
|
81
81
|
*/
|
|
82
82
|
readonly noViewport?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Route ALL traffic and DNS through one SOCKS proxy, as a SOCKS URL
|
|
85
|
+
* (`socks5h://host:1080` or `socks5://user:pass@host:1080`). `socks5h` tunnels
|
|
86
|
+
* DNS too (no leak); `socks5` allows local DNS. Omit for a direct connection.
|
|
87
|
+
*/
|
|
88
|
+
readonly proxy?: string;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
91
|
* Build the `incur` CLI that wraps `core`'s verb surface (PRD Implementation
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAI,MAAM,OAAO,CAAC;AAC7B,OAAO,EACN,WAAW,EACX,sBAAsB,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAI,MAAM,OAAO,CAAC;AAC7B,OAAO,EACN,WAAW,EACX,sBAAsB,EAYtB,KAAK,UAAU,EACf,KAAK,oBAAoB,EASzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEN,KAAK,eAAe,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG5C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,aAAa,CAAC;AAMnC;;;;GAIG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC,4FAA4F;AAC5F,MAAM,WAAW,OAAO;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CA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