@trawlme/skills 1.3.2 → 1.3.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/package.json
CHANGED
|
@@ -39,7 +39,7 @@ If the user gets `Session expired or invalid. Run: trawl login`, their stored JW
|
|
|
39
39
|
CI-relevant env vars. The first three are per-invocation session overrides — they take precedence over stored config without writing to disk (for normal commands; note `trawl login` itself still persists a token even when `TRAWL_TOKEN` is set):
|
|
40
40
|
- `TRAWL_TOKEN` — session JWT, takes precedence over `trawl login`'s stored token
|
|
41
41
|
- `TRAWL_API_URL` — API base URL, takes precedence over `trawl login --url`
|
|
42
|
-
- `TRAWL_TIMEOUT` — per-request fetch timeout in ms (default 30000)
|
|
42
|
+
- `TRAWL_TIMEOUT` — per-request fetch timeout in ms (default 30000; 300000 for `scraps run`, `data --fresh`, and `trigger --wait` since CLI 1.18.4 — these hit the same server-side scrap-execute path, which legitimately runs 30-250s; this env var still overrides that longer default too, higher or lower)
|
|
43
43
|
- `DEBUG` — any truthy value prints the full error stack trace to stderr, same effect as the global `--debug` flag
|
|
44
44
|
|
|
45
45
|
`TRAWL_CONFIG_DIR` is different — it **redirects where the CLI reads and writes** its config file (so `trawl login` persists there). Point it at an ephemeral dir for hermetic runs, e.g. `TRAWL_CONFIG_DIR=$(mktemp -d)`.
|
|
@@ -56,11 +56,15 @@ trawl scraps list --json # JSON array
|
|
|
56
56
|
trawl scraps list --status failure # filter by last-run status
|
|
57
57
|
trawl scraps list --status success
|
|
58
58
|
trawl scraps list --status never # never run
|
|
59
|
+
trawl scraps list --status running # run currently executing (status: null)
|
|
60
|
+
trawl scraps list --status regression # last run succeeded but item count regressed vs baseline
|
|
59
61
|
trawl scraps list --limit 10 # cap output client-side
|
|
60
62
|
trawl scraps list --page 2 # single-page mode (one 50-row page)
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
> **Pagination:** `list` fetches **all** scraps by default (it auto-paginates internally at 200/page until a short page). `--page N` switches to single-page mode — one 50-row page, no auto-pagination. `--limit N` caps the output client-side. `--limit` and `--page` are mutually exclusive (usage error, exit 2). Because the default fetches everything, a `jq`-by-title lookup over `list --json` sees every scrap — no page-1 blind spot.
|
|
65
|
+
> **Pagination:** `list` fetches **all** scraps by default (it auto-paginates internally at 200/page until a short page). `--page N` switches to single-page mode — one 50-row page, no auto-pagination. `--limit N` caps the output client-side. `--limit` and `--page` are mutually exclusive (usage error, exit 2). **Since CLI 1.18.3**, a non-numeric `--limit`/`--page` value (e.g. `abc`) is also a usage error, exit `2` — before 1.18.3 it silently became `NaN`, which truncated results to 0 rows or sent a bare `?page=NaN` to the server with no warning. Because the default fetches everything, a `jq`-by-title lookup over `list --json` sees every scrap — no page-1 blind spot.
|
|
66
|
+
|
|
67
|
+
**Since CLI 1.18.3**, a scrap whose last run is still executing (`status: null` server-side) renders as `running` — a cyan `↻` in the table, matched by `--status running`. Previously an in-flight run had no distinct state anywhere in `list`. **Since CLI 1.18.4**, a run whose item count regressed vs baseline (`statusDetail: 'regression'`) renders as `regression` — an amber `▼`, matched by `--status regression` — distinct from the red `✗` a genuine failure gets (the write actually succeeded; only the count dropped). `doctor` shows the same distinction as its own amber `● regression` badge instead of bucketing it under `● failed`.
|
|
64
68
|
|
|
65
69
|
### Inspect a single scrap
|
|
66
70
|
|
|
@@ -75,16 +79,20 @@ trawl scraps data <id> --json # last run output (the scraped data)
|
|
|
75
79
|
- `--errors` — show failure diagnostics inline when the last run failed.
|
|
76
80
|
- `--json` — machine-readable output.
|
|
77
81
|
|
|
78
|
-
**Honest data states (since CLI 1.18.2):** `[]` is reserved for a genuine zero-item run. Every other outcome is a distinct error envelope instead of a silent empty array:
|
|
82
|
+
**Honest data states (since CLI 1.18.2, extended 1.18.3):** `[]` is reserved for a genuine zero-item run. Every other outcome is a distinct error envelope instead of a silent empty array — except a regression, which is a degraded *success*, not an error:
|
|
79
83
|
|
|
80
84
|
| State | Result |
|
|
81
85
|
|---|---|
|
|
82
86
|
| Genuine zero-item run (incl. a run with `statusDetail: 'empty'`) | `[]`, exit `0` |
|
|
87
|
+
| Run in progress (`status: null` — the run is still executing, node persists `{status:null, statusDetail:null, inFlight:true}` the instant a run starts) | error, exit `1`, kind `in_progress` — "Run in progress — retry shortly"; never suggests `--fresh` (the run already holds the server-side lock, so `--fresh` would just 429 against it) — **since CLI 1.18.3** |
|
|
88
|
+
| Item count regressed vs baseline (`statusDetail: 'regression'`) | the **real, non-empty items** on stdout, exit `0` — plus a stderr warning pointing at `trawl scraps doctor <id>` for diagnosis. The write persisted before the regression was flagged, so treating it as a failure would hide genuine data behind a false negative — **since CLI 1.18.3** |
|
|
83
89
|
| Scrap has never run | error, exit `4`, kind `not_found` — "Run it first... or pass --fresh" |
|
|
84
|
-
| Last run failed (`status: false
|
|
85
|
-
| Payload aged out of retention (server keeps only the newest row per scrap+status bucket) | error, exit `4`, kind `not_found` |
|
|
90
|
+
| Last run failed (`status: false`, not `empty`, not `regression`) | error, exit `1`, kind `run_failed` — points to `--errors` |
|
|
91
|
+
| Payload aged out of retention (server keeps only the newest row per scrap+status bucket) — **including an aged-out regression row**, which gets this same envelope instead of fabricated items | error, exit `4`, kind `not_found` |
|
|
92
|
+
|
|
93
|
+
Before 1.18.2 the zero-item/never-run/failed/aged-out states collapsed into the same `[]` / "No data yet." Before 1.18.3, a run still in progress fell through to the misleading "aged out of retention" message (status `null` isn't `false`, so it skipped the failure check, then found no persisted payload yet), and a regression row was misclassified as `run_failed` — hiding real, already-persisted items behind an error. Never assume "no data" from an empty result without checking the exit code and `kind`.
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
**`--fresh` regression warning (since CLI 1.18.5):** the table above (regression row) already applied to the default persisted-data path; `data --fresh` now gets the same treatment — after the live run finishes, the CLI does a follow-up `GET /api/scraps/:id` and prints a stderr warning pointing at `scraps doctor <id>` if the finalized run regressed vs baseline. It still prints the real items on stdout either way (exit `0`) — the check is best-effort and never gates the actual output. Before 1.18.5, `--fresh` rendered items with no regression check at all, because the `load()` response's own embedded `scrap.history[0]` can't be trusted for this. (Ordering caveat: the standalone `GET /api/scraps/:id` read — the one the output-shape section describes — returns `history` newest-first, so `history[0]` is the latest run there. The `load()` *response* embed is the exception: node appends the just-finished run onto the *end* of that array, and the regression flip lands via a raw DB patch issued after the response was already built, so `load()`'s echoed `history[0]` is both stale and not-newest. That's exactly why the CLI issues a fresh `GET` rather than reading `load()`'s embed.)
|
|
88
96
|
|
|
89
97
|
### Create a scrap
|
|
90
98
|
|
|
@@ -127,19 +135,26 @@ trawl scraps update <id> --tier tier2 --json # full scrap JSON, o
|
|
|
127
135
|
|
|
128
136
|
- `--tier tier0..tier4` (create + update) — requests a starting proxy tier. It's **clamped to tier3** if the target domain isn't allow-listed for tier4, even though the flag accepts `tier4` without error.
|
|
129
137
|
- Since CLI 1.18.2, **both `create` and `update`** read `_tierOverride` back from the server and render the same honest truth (previously only `update` echoed the clamp; `create` was silent): a clamp (`⚠ proxyTier requested tier4 → applied tier3`), an allowed ceiling raise (+ spend warning if any), or a refusal.
|
|
130
|
-
- **Old-server fallback (since CLI 1.18.2):** if a tier was requested but the response carries no `_tierOverride` at all, the CLI no longer echoes the requested value as if it were applied — it prints `⚠ Server did not confirm the tier change (older server) — verify with: trawl scraps get <id>` instead. Never assume the requested tier was honored on an unconfirmed response.
|
|
138
|
+
- **Old-server fallback (since CLI 1.18.2):** if a tier was requested but the response carries no `_tierOverride` at all, the CLI no longer echoes the requested value as if it were applied — it prints `⚠ Server did not confirm the tier change (older server) — verify with: trawl scraps get <id>` instead. Never assume the requested tier was honored on an unconfirmed response. **Since CLI 1.18.3**, `--json` carries the same signal in machine-readable form: the emitted scrap object gets `"_tierUnconfirmed": true` under exactly this condition (tier requested, no `_tierOverride` in the response) — the counterpart to the stderr warning, since a `--json` caller has no reliable reason to read stderr. Never present when `_tierOverride` came back, never fabricated otherwise.
|
|
131
139
|
- `--force-tier tier0..tier4` (update only) — raises the tier **ceiling** past that auto-cap. History-gated: the server may refuse it (the CLI prints `✗ tier ceiling override refused: <reason>` and exits `1`) or it may cost more, depending on the scrap's run history.
|
|
132
|
-
- `--json` (create + update, since CLI 1.18.2): success returns the full scrap object
|
|
140
|
+
- `--json` (create + update, since CLI 1.18.2): success returns the full scrap object; when a tier was requested it carries **either** `_tierOverride` (the server confirmed — inspect it for the applied/clamped/refused truth) **or** `_tierUnconfirmed: true` (old server, unconfirmed — see the fallback bullet above), never both, and neither when no tier was requested. A refused tier returns the standard error envelope on stdout and exits `1` — same outcome as human mode, just machine-readable.
|
|
133
141
|
- Either way, verify what tier a run actually used with `trawl scraps history <id>` / `trawl scraps run-info <hid>` (on servers released before mid-July 2026 the `history` list shows these columns blank — `run-info` always has them) — don't assume the requested tier was honored.
|
|
134
142
|
|
|
135
143
|
### Run / trigger / watch
|
|
136
144
|
|
|
137
|
-
- `trawl scraps run <id>` — synchronous run via the load endpoint, blocks until done
|
|
138
|
-
- `trawl scraps run <id> --watch` — same
|
|
145
|
+
- `trawl scraps run <id>` — synchronous run via the load endpoint, blocks until done. Arms a 300s timeout (since CLI 1.18.4 — see `TRAWL_TIMEOUT` above) instead of the generic 30s default, because this endpoint legitimately runs 30-250s server-side.
|
|
146
|
+
- `trawl scraps run <id> --watch` — same, then polls for progress (since CLI 1.18.4 — see below; it does **not** stream)
|
|
139
147
|
- `trawl scraps trigger <id>` — **async by default**: queues the worker run and returns immediately (no waiting on the 30-250s run)
|
|
140
|
-
- `trawl scraps trigger <id> --wait` — synchronous: block until the run completes (legacy behaviour)
|
|
141
|
-
- `trawl scraps trigger <id> --watch` — queue, then
|
|
142
|
-
- `trawl scraps watch <id>` — attach to an in-progress run's activity stream
|
|
148
|
+
- `trawl scraps trigger <id> --wait` — synchronous: block until the run completes (legacy behaviour). Same 300s timeout as `run`, since CLI 1.18.4.
|
|
149
|
+
- `trawl scraps trigger <id> --watch` — queue, then poll for progress (since CLI 1.18.4 — see below; it does **not** stream)
|
|
150
|
+
- `trawl scraps watch <id>` — the standalone command: attach to an in-progress run's activity stream over SSE. **Unchanged** by any of the above — this is the one that actually streams.
|
|
151
|
+
|
|
152
|
+
**`--watch` is poll-based, not a live stream (since CLI 1.18.4):** `scraps run --watch` and `scraps trigger --watch` used to open the activities SSE stream after launching the run — but that showed nothing either way: the activities SSE endpoint has no backlog, so by the time a *synchronous* run had already finished there was nothing left to emit, and for the default *async* `trigger` the run executes in a separate cron-consumer pod whose events never reach the API pod holding the SSE connection at all. Both flags now instead poll two Mongo-backed REST reads every 2s, up to 300s: `GET /api/scraps/:id` for terminal status, and the activities list endpoint for new lines — printing each new activity line as it appears, then the terminal status. Before doing so they print this notice:
|
|
153
|
+
> Live activity streaming has no signal for this run (async/cross-pod) — polling for progress instead…
|
|
154
|
+
|
|
155
|
+
Control flow depends on the path: for a **synchronous** run (`run`, or `trigger --wait`) the CLI first blocks on the run request itself (now with the 300s long-run timeout), and the poll runs *afterward* — so it's a one-pass replay of the recorded activity for a run that has already finished, not live-during-execution progress. For the default **async** `trigger` (`?wait=false`, returns immediately), the poll runs *concurrently* while a separate cron pod executes the run, so there the lines appear as the run progresses. Either way, a run that never reaches a terminal status within the 300s poll window prints an honest timeout notice pointing at `scraps doctor <id>`, instead of hanging silently or lying about completion. **Since CLI 1.18.5**, this poll also correctly tracks a `trigger --watch` call that deduped onto an already-in-flight worker job (i.e. the scrap was triggered again while a run was still executing) — before 1.18.5 that case could falsely time out waiting for a history id that would never change, because the dedup reuses the existing row instead of creating a new one. `--watch` is now safe to use on retry or concurrent `trigger` calls.
|
|
156
|
+
|
|
157
|
+
`scraps watch <id>` (the standalone command above) is a separate code path and is unaffected by any of this — it still opens the live SSE stream directly.
|
|
143
158
|
|
|
144
159
|
### Inspect past runs
|
|
145
160
|
|
|
@@ -172,14 +187,26 @@ For per-scrap authentication, see the `trawl-scrap-account` skill. CLI commands:
|
|
|
172
187
|
The session JWT authenticates two different ways depending on the endpoint:
|
|
173
188
|
|
|
174
189
|
```bash
|
|
175
|
-
|
|
176
|
-
|
|
190
|
+
TOKEN=$(trawl token)
|
|
191
|
+
|
|
192
|
+
# MCP endpoint — accepts the session JWT as a Bearer token. This is a real,
|
|
193
|
+
# runnable JSON-RPC 2.0 call (tools/list) against the Streamable HTTP
|
|
194
|
+
# transport — verified against trawl_node's mcp.controller.js:
|
|
195
|
+
curl --fail-with-body -X POST https://api.trawl.me/api/mcp \
|
|
196
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
197
|
+
-H "Content-Type: application/json" \
|
|
198
|
+
-H "Accept: application/json, text/event-stream" \
|
|
199
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
|
|
177
200
|
|
|
178
201
|
# Raw REST (/api/scraps, etc.) — the JWT strategy is COOKIE-ONLY (reads the TOKEN cookie).
|
|
179
202
|
# Bearer is NOT accepted here; pass the JWT as the TOKEN cookie instead:
|
|
180
|
-
curl -H "Cookie: TOKEN=$
|
|
203
|
+
curl --fail-with-body -H "Cookie: TOKEN=$TOKEN" https://api.trawl.me/api/scraps
|
|
181
204
|
```
|
|
182
205
|
|
|
206
|
+
Capture `$(trawl token)` into `TOKEN` once and reuse it — inlining the substitution separately into each curl call can leave a call running with a silently empty token if the substitution fails. `--fail-with-body` makes curl exit non-zero on an HTTP error response (e.g. an empty/expired token → 401) while still printing the response body, instead of a `curl` that "succeeds" (exit 0) against an error page.
|
|
207
|
+
|
|
208
|
+
`/api/mcp` only accepts `POST`. `GET` (and `DELETE`) return a JSON-RPC-shaped `405` — this server runs the stateless Streamable HTTP transport, which has no use for the SSE-resume/session-close semantics those methods exist for elsewhere in the spec. Always POST a JSON-RPC envelope. The `Accept` header must list **both** `application/json` and `text/event-stream` — the SDK transport rejects a POST with either one missing as `406 Not Acceptable` (`Client must accept both application/json and text/event-stream`), regardless of auth.
|
|
209
|
+
|
|
183
210
|
## Common patterns
|
|
184
211
|
|
|
185
212
|
**"Run my X scrap and show me the result"**
|
|
@@ -200,9 +227,14 @@ trawl scraps autofix <id> --json # raw autofix JSON
|
|
|
200
227
|
trawl scraps data <id> --errors # failure diagnostics inline with the data command
|
|
201
228
|
trawl scraps snapshot <id> --error -o /tmp/error.html # download the error-path HTML
|
|
202
229
|
trawl scraps snapshot <id> -o /tmp/page.html # download the captured page HTML
|
|
230
|
+
trawl scraps snapshot <id> --json # {"status":"no_runs"} exit 0 if never run — since CLI 1.18.4
|
|
203
231
|
```
|
|
204
232
|
Note: the CLI surfaces the abstract proxy Tier (0–4) + diagnostics + autofix, but **not** cost or proxy nature/IP/vendor — those are admin-only by design.
|
|
205
233
|
|
|
234
|
+
**No-runs shape, unified across commands:** `doctor --json`, `autofix --json`, `data --errors --json` (**since CLI 1.18.3**), and `snapshot --json` (**since CLI 1.18.4**) all return `{"status":"no_runs"}` (exit `0`) for a scrap that has **never run** — `doctor` had this shape since CLI 1.18.0; `autofix`/`data --errors` joined it in 1.18.3 (both used to return a bare `null`, indistinguishable from any other absent-payload state); `snapshot` joined it in 1.18.4 (it had no `--json` mode at all before then — a never-run scrap without `-o` just printed "No runs yet." to stdout and exited `0`, no machine-readable signal). Don't confuse it with `autofix --json`'s bare `null`, which means a run *did* happen but had no auto-fix attempt on it — genuinely "no data", a different state from "never ran at all". A run still **in progress** shows a `running` badge on `doctor`/`data --errors` (human mode) — never `failed` (**since CLI 1.18.3**).
|
|
235
|
+
|
|
236
|
+
**`snapshot -o <file>` on a never-run scrap (since CLI 1.18.4):** without `--json`, this now exits `4` (`not_found`) instead of silently exiting `0` with nothing written — before 1.18.4 a script checking only the exit code couldn't tell "no file was produced" from success. `--json` takes priority when both flags are passed together.
|
|
237
|
+
|
|
206
238
|
**"Create a job that runs every morning"**
|
|
207
239
|
```bash
|
|
208
240
|
trawl scraps create -t "Morning crawl" -u "https://..." -d "Daily crawl at 8am" -r '...'
|
|
@@ -217,7 +249,7 @@ trawl scraps run <id> --watch
|
|
|
217
249
|
|
|
218
250
|
## Other commands
|
|
219
251
|
|
|
220
|
-
- `trawl scraps banner <id> -f <path>` — upload a banner image (jpg/
|
|
252
|
+
- `trawl scraps banner <id> -f <path>` — upload a banner image (png/jpg/jpeg/webp) for a scrap; see the `trawl-scrap-banner` skill for the full generate + upload pipeline. **Since CLI 1.18.4**, any other extension is a usage error, exit `2` (e.g. `Unsupported image type ".gif" — use png, jpg, or webp.`) — before 1.18.4 an unrecognized extension silently uploaded under a fabricated `image/png` Content-Type instead of being refused.
|
|
221
253
|
- `trawl logout` — clear stored credentials
|
|
222
254
|
- `trawl skills list/install/uninstall/update` — manage the bundled Claude Code skills (this package)
|
|
223
255
|
- `trawl telemetry` — inspect/toggle usage telemetry (`TRAWL_TELEMETRY=0` / `DO_NOT_TRACK=1` env overrides also work)
|
|
@@ -284,15 +316,16 @@ Every command uses these exit codes — check `$?` instead of parsing stderr tex
|
|
|
284
316
|
| Code | Meaning |
|
|
285
317
|
|---|---|
|
|
286
318
|
| `0` | success |
|
|
287
|
-
| `1` | unmapped API error (HTTP status other than 401/404) or an unhandled bug — also `scraps data`'s "last run failed"
|
|
288
|
-
| `2` | usage error — invalid flag/value or malformed input (bad ObjectId, invalid `--tier` value, malformed `-p` JSON, missing file, `--limit`+`--page` conflict) **and, since CLI 1.18.2, commander parse errors** (unknown option/command, missing required arg — previously exit `1`) |
|
|
319
|
+
| `1` | unmapped API error (HTTP status other than 401/404) or an unhandled bug — also `scraps data`'s "last run failed" (kind `run_failed`) and "run in progress" (kind `in_progress`, **since CLI 1.18.3**) states, and a refused tier override (kind `unknown`) |
|
|
320
|
+
| `2` | usage error — invalid flag/value or malformed input (bad ObjectId, invalid `--tier` value, malformed `-p` JSON, missing file, `--limit`+`--page` conflict, **since CLI 1.18.3 a non-numeric `--limit`/`--page` value**, **since CLI 1.18.4 an unsupported `banner -f` file extension**) **and, since CLI 1.18.2, commander parse errors** (unknown option/command, missing required arg — previously exit `1`) |
|
|
289
321
|
| `3` | auth error — server **401** (token expired/invalid) **or no stored token at all** (since CLI 1.18.2 — previously exit `1`, kind `unknown`) |
|
|
290
|
-
| `4` | not found — 404, or (for `scraps data`) never-ran / retention-aged-out |
|
|
322
|
+
| `4` | not found — 404, or (for `scraps data`) never-ran / retention-aged-out, or (for `scraps snapshot -o <file>` without `--json`, since CLI 1.18.4) never-ran |
|
|
291
323
|
| `5` | network error (unreachable API, timeout) |
|
|
292
324
|
|
|
293
|
-
|
|
325
|
+
Edges to know:
|
|
294
326
|
- **No stored token at all** now exits `3` with kind `auth` (`Not logged in. Run: trawl login`) — the same path a real 401 takes. Before CLI 1.18.2 this was a generic exit `1`, kind `unknown`, indistinguishable from an arbitrary bug. `trawl token` follows the same rule.
|
|
295
327
|
- **Unknown flags / missing required args** now exit `2` (usage), same bucket as bad flag *values* — before CLI 1.18.2 commander caught these before the command ran and they fell through to exit `1`.
|
|
328
|
+
- **Local auth failures never carry `status:401` (since CLI 1.18.3):** "no stored token" and `trawl token`'s own "locally-decoded expired token" check both fail entirely client-side — no HTTP call was made, so the `--json` envelope is `{"error":{"message":"...","kind":"auth"}}` with **no `status` field**. Only a real server-issued 401 response carries `status:401`. Exit code and `kind` are unchanged (still `3` / `auth`) — only the envelope shape differs. Before 1.18.3 the local case fabricated `status:401` as if the server had said so.
|
|
296
329
|
|
|
297
330
|
### `--json` failure envelope
|
|
298
331
|
|
|
@@ -302,9 +335,15 @@ When a command fails **after argument parsing** with `--json` set, the error goe
|
|
|
302
335
|
{"error":{"message":"Session expired or invalid. Run: trawl login","kind":"auth","status":401}}
|
|
303
336
|
```
|
|
304
337
|
|
|
305
|
-
|
|
338
|
+
A local auth failure (no token / expired-token check with no HTTP round trip — see the edge above) omits `status` entirely:
|
|
339
|
+
|
|
340
|
+
```json
|
|
341
|
+
{"error":{"message":"Not logged in. Run: trawl login","kind":"auth"}}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
`kind` is one of `auth` / `not_found` / `api` / `network` / `usage` / `unknown`, plus `run_failed` and `in_progress` (both `scraps data`-specific, not part of the shared classifier). `status` is only present for real HTTP-backed errors.
|
|
306
345
|
|
|
307
|
-
Since CLI 1.18.2, commander-level parse errors (unknown flag, missing required arg) **also** emit the envelope — `{"error":{"message":"...","kind":"usage"}}` (no `status` field) — whenever `--json` appears anywhere on the command line (scanned from raw argv, since parsing fails before any command's own `--json` flag can be read). Exit code `2`. Before 1.18.2 these always bypassed the envelope: empty stdout, a plain-text error on stderr, exit `1`.
|
|
346
|
+
Since CLI 1.18.2, commander-level parse errors (unknown flag, missing required arg) **also** emit the envelope — `{"error":{"message":"...","kind":"usage"}}` (no `status` field) — whenever `--json` appears anywhere on the command line (scanned from raw argv, since parsing fails before any command's own `--json` flag can be read). Exit code `2`. Before 1.18.2 these always bypassed the envelope: empty stdout, a plain-text error on stderr, exit `1`. **Since CLI 1.18.3**, that argv scan stops at the first bare `--` (end-of-options): `scraps list -- --json` no longer triggers the envelope, because everything after a literal `--` is a positional argument to commander, not a flag — even one that reads `--json`. Before 1.18.3 an unscoped `argv.includes('--json')` still matched it and wrongly emitted a JSON envelope for a plain usage error that never actually requested `--json`.
|
|
308
347
|
|
|
309
348
|
## What this skill does NOT do
|
|
310
349
|
|
|
@@ -101,7 +101,7 @@ Requires an authenticated CLI session first — `trawl login` (or `TRAWL_TOKEN`
|
|
|
101
101
|
trawl scraps banner ${scrapId} -f /tmp/${siteName}-banner.png
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
`-f/--file` also accepts `.jpg` and `.webp`, not just `.png` — webp gives smaller uploads for the same visual quality if size matters.
|
|
104
|
+
`-f/--file` also accepts `.jpg` and `.webp`, not just `.png` — webp gives smaller uploads for the same visual quality if size matters. Since CLI 1.18.4, any other extension is rejected with a usage error (exit 2) rather than uploaded mislabeled — png/jpg/jpeg/webp only.
|
|
105
105
|
|
|
106
106
|
CLI confirms upload. Banner is immediately visible on trawl.me.
|
|
107
107
|
|
|
@@ -91,6 +91,6 @@ Each run gets one `history` row with `status` (tri-state `true`/`false`/`null`)
|
|
|
91
91
|
- **`success`** — `returnData(arr)` called with at least one item.
|
|
92
92
|
- **`empty`** — an explicit `returnData([])` — ran clean but returned zero items. Usually means a selector broke; see `references/anti-patterns.md`. Never calling `returnData` at all is NOT `empty`: the run persists as `success` with a `null` payload, which `trawl scraps data` later reports as a `not_found` error (it looks like the payload aged out of retention). Always call `returnData`, even with `[]`.
|
|
93
93
|
- **`error`** — the script threw. Throw only for structural failures (see the Resilience section in `SKILL.md`) — a per-field `try/catch` that degrades a field to `null` does NOT produce `error`, it stays `success` with that field `null`.
|
|
94
|
-
- **`regression`** — item count dropped sharply vs. recent history, computed server-side after a successful run.
|
|
94
|
+
- **`regression`** — item count dropped sharply vs. recent history, computed server-side after a successful run. This is a degraded *success*, not a failure: the items DID persist. `trawl scraps data <id>` (CLI 1.18.3+) returns those real items on stdout, exit `0`, with a stderr warning pointing at `trawl scraps doctor <id>` for diagnosis — it never collapses a regression row into the failure path. `data --fresh` (CLI 1.18.5+) gets the same stderr warning for a live run that regresses. Use `doctor <id>` to see the baseline count vs. the actual count and decide whether the drop is a real site change or a broken selector.
|
|
95
95
|
|
|
96
96
|
Ragged objects (an omitted key on some items) don't get their own status — they just make the returned array inconsistent for whatever consumes it downstream. Keep every item's key set identical (`null` for absent values) so `success` runs are actually usable.
|