@trawlme/skills 1.4.3 → 1.4.4
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
|
@@ -48,7 +48,9 @@ npm install -g @trawlme/cli
|
|
|
48
48
|
trawl skills install
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
The CLI bundles the skills and keeps them in sync with the CLI version.
|
|
51
|
+
The CLI bundles the skills and keeps them in sync with the CLI version — every `trawl` command re-syncs a skill whose installed version drifts from the CLI's.
|
|
52
|
+
|
|
53
|
+
Since `@trawlme/cli` 3.10, `trawl login` also installs any bundled skill you don't already have when run interactively — no separate `trawl skills install` needed. It prints exactly what it installed, plus the one thing you have to do yourself: **restart Claude Code**, since skills are only picked up at session start.
|
|
52
54
|
|
|
53
55
|
## Migrating from v0.1.x
|
|
54
56
|
|
|
@@ -66,6 +68,14 @@ Example prompts:
|
|
|
66
68
|
- "scrape a site behind login without giving Trawl my credentials" (`trawl-scrap-account`)
|
|
67
69
|
- "test my scrap locally before pushing" (`trawl-scrap-local-test`)
|
|
68
70
|
|
|
71
|
+
### Authenticated scraps: session capture
|
|
72
|
+
|
|
73
|
+
With `@trawlme/cli` 3.12 or later, `trawl-scrap-account` walks Claude through `trawl scraps account session capture <id>` for a site that needs a login — it opens a real, visible Chrome window at the scrap's target URL, you log in there exactly as you normally would (2FA included), and the CLI reads the resulting session over the Chrome DevTools Protocol (cookies and per-origin localStorage) and uploads it. No manual cookie export.
|
|
74
|
+
|
|
75
|
+
> You stay authenticated as yourself throughout — Trawl never sees your credentials, only the resulting session. Responsibility for lawful use of that session stays with you; this isn't legal advice.
|
|
76
|
+
|
|
77
|
+
This needs a local interactive terminal with a real display — it doesn't work headless, in CI, or over a plain SSH session. `session set -c <file>` (manual cookie upload) remains the fallback when capture can't run.
|
|
78
|
+
|
|
69
79
|
## Commands
|
|
70
80
|
|
|
71
81
|
```
|
package/package.json
CHANGED
|
@@ -212,7 +212,7 @@ TOKEN=$(trawl token)
|
|
|
212
212
|
|
|
213
213
|
# MCP endpoint — accepts the session JWT as a Bearer token. This is a real,
|
|
214
214
|
# runnable JSON-RPC 2.0 call (tools/list) against the Streamable HTTP
|
|
215
|
-
# transport — verified against
|
|
215
|
+
# transport — verified end-to-end against a live server:
|
|
216
216
|
curl --fail-with-body -X POST https://api.trawl.me/api/mcp \
|
|
217
217
|
-H "Authorization: Bearer $TOKEN" \
|
|
218
218
|
-H "Content-Type: application/json" \
|
|
@@ -258,7 +258,7 @@ Note: the CLI surfaces the abstract proxy Tier (0–4) + diagnostics + autofix,
|
|
|
258
258
|
|
|
259
259
|
**`failureKind: 'auth'` — the target site wants a login, not you.** `doctor`/`run-info`/`history` can show this on a run: the worker landed on a known login route and the run came back empty — the SITE is asking for a session, not blocking the request outright. Node ranks a worker-flagged block ABOVE this (precedence is block > auth > selector > nav > empty): `auth` only fires on an empty run that is NOT also block-flagged. Once it does fire, it skips auto-fix (a selector rewrite can never clear a login wall). Treat it as a distinct case from a blocked/wall run, not a subtype of one:
|
|
260
260
|
- **Send the user to the `trawl-scrap-account` skill**, not to a "no reliable bypass" explanation. The fix is that skill's `session capture` command, not a selector rewrite or a proxy-tier bump.
|
|
261
|
-
- A run can carry BOTH `failureKind: 'auth'` and a matched vendor wall
|
|
261
|
+
- A run can carry BOTH `failureKind: 'auth'` and a matched vendor wall when the vendor is one the server's block classifier doesn't yet recognize by name — e.g. `block.kind` naming Kasada. The server's block classifier and the CLI's own vendor list (`WALL_VENDOR_PATTERNS` in `doctor.ts`) are maintained separately: the CLI's list matches Kasada and reports a wall, but the server's classifier doesn't recognize it, so the block flag never gets set and `auth` still fires on the same run instead of `block` pre-empting it. For every vendor the server's classifier DOES match (Akamai, Cloudflare, DataDome, PerimeterX), `block` always wins first and the two never coexist. Don't collapse the Kasada case into one story — state both readings rather than choosing, the same way `doctor` hedges instead of asserting one.
|
|
262
262
|
|
|
263
263
|
**Don't confuse this with the CLI's own `kind: 'auth'`** (Errors to recognize / Exit codes below). The `--json` error envelope's `kind` field means **your Trawl session** is the problem — an expired or missing JWT, exit `3` — and the fix is `trawl login`. `failureKind: 'auth'` on a *run* means the **scraped site** wants credentials — the fix is `trawl scraps account session capture <id>` (see `trawl-scrap-account`). Same string, two unrelated axes (this CLI's own auth vs. the target site's auth) on two different objects (a thrown CLI error vs. a persisted run) — sending someone to `trawl login` for a `failureKind:'auth'` run fixes nothing.
|
|
264
264
|
|
|
@@ -35,7 +35,7 @@ export function buildContext(flags, readFile = (p) => readFileSync(resolve(p), '
|
|
|
35
35
|
account.session = { cookies: JSON.parse(readFile(cookiesPath)) };
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
// Parity with the worker
|
|
38
|
+
// Parity with the production worker: also expose creds under TRAWL.account.*.
|
|
39
39
|
// null when nothing was provided, mirroring buildTrawlAccount's null-when-empty contract.
|
|
40
40
|
const hasAccount = !!(account.username || account.password || account.session);
|
|
41
41
|
TRAWL.account = hasAccount ? account : null;
|