@trawlme/skills 1.4.1 → 1.4.2
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
|
@@ -54,9 +54,10 @@ Since CLI **v2.0.0** the agent-facing verbs are also top-level: `trawl list / ge
|
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
trawl create https://example.com/products --prompt "track product prices"
|
|
57
|
+
trawl create --url https://example.com/products --prompt "track product prices" # --url alias, since 2.1.0
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
Optional flags: `--no-autofix` (skip the auto-fix retry on a failed first run), `--json` (raw API payload on stdout).
|
|
60
|
+
Optional flags: `--no-autofix` (skip the auto-fix retry on a failed first run), `--json` (raw API payload on stdout), `--url <url>` (**since 2.1.0**) — an alias of the positional `url` argument, for callers that prefer a named flag. Exactly one URL is required: pass the positional OR `--url`, never neither. Passing both is fine only when they're identical; two *different* URLs is a usage error (exit 2) rather than the CLI silently picking one.
|
|
60
61
|
|
|
61
62
|
One call: the server generates the extraction code (AI), creates a **persistent, self-healing scrap**, and triggers its first run (auto-fix on failure by default). Requires an api-key scoped `trawl:scraps:create` (or a session JWT). Response: `{ success, scrap, historyId }`.
|
|
62
63
|
|
|
@@ -65,6 +66,7 @@ Critical semantics for agents:
|
|
|
65
66
|
- **NOT idempotent + not instant** — generation + first run legitimately takes 30-250s (the CLI already uses the 300s long-run timeout; a global `TRAWL_TIMEOUT` override clamps it). On a client-side timeout the scrap **may still have been created server-side**: run `trawl list` before retrying — a retry creates a DUPLICATE scrap and burns quota.
|
|
66
67
|
- **Daily schedule by default** — a wizard scrap is created with a daily cron (07:00 UTC); it re-runs and meters every day until you change it (`trawl scraps update <id> --cron <expr>` or `--no-cron`).
|
|
67
68
|
- **`success:false` (exit 1) ≠ retry** — the scrap EXISTS and auto-fix is retrying in the background: poll `trawl data <id>` / `trawl run-info <historyId>`, never re-run `create`.
|
|
69
|
+
- **On success, human mode proves the value (since 2.3.0)** — after a successful first run, `create` prints a small best-effort data sample (item count, field names, one truncated value) below the scrap summary, then `Next step: trawl data <id>` (with `trawl get <id>` noted as the secondary, metadata-only view). The sample is bonus output only: any fetch/parse failure is swallowed silently and never turns a successful create into an error. `--json` is unaffected — it always returns the raw `{ success, scrap, historyId }` payload with no sample appended.
|
|
68
70
|
- Distinct from `trawl scraps create` below (raw Puppeteer script, no AI).
|
|
69
71
|
|
|
70
72
|
### List scraps
|
|
@@ -268,7 +270,8 @@ trawl scraps run <id> --watch
|
|
|
268
270
|
|
|
269
271
|
## Other commands
|
|
270
272
|
|
|
271
|
-
- `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.
|
|
273
|
+
- `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. `--json` (**since CLI 1.21.0**) returns the full updated scrap object.
|
|
274
|
+
- `trawl upgrade [--check] [--json]` — self-update the CLI itself (**since @trawlme/cli 3.0.0**; replaced the old top-level `trawl update`, which is now `trawl scraps update <id>` for a scrap). Compares the installed version to npm's `latest` and, with no flags, shells out to `npm install -g @trawlme/cli@latest`. `--check` only reports whether an update is available (never installs) and exits `1` when one is — a script-friendly gate. `--json` emits `{ package, current, latest, upToDate, upgraded }` on every SUCCESSFUL path (up-to-date, `--check`, or a completed install) instead of the human-readable lines. An install failure (missing `npm`, `EACCES` on the global prefix) prints the manual fallback command and exits `1`; under `--json` the failure emits the error envelope `{"error":{"message":"upgrade failed: …","kind":"upgrade_failed"}}` INSTEAD of the success object — automation must branch on the presence of `error`.
|
|
272
275
|
- `trawl logout` — clear stored credentials
|
|
273
276
|
- `trawl skills list/install/uninstall/update` — manage the bundled Claude Code skills (this package)
|
|
274
277
|
- `trawl telemetry` — inspect/toggle usage telemetry (`TRAWL_TELEMETRY=0` / `DO_NOT_TRACK=1` env overrides also work)
|
|
@@ -105,7 +105,11 @@ trawl scraps banner ${scrapId} -f /tmp/${siteName}-banner.png
|
|
|
105
105
|
|
|
106
106
|
CLI confirms upload. Banner is immediately visible on trawl.me.
|
|
107
107
|
|
|
108
|
-
**Failure detection:**
|
|
108
|
+
**Failure detection:** the exit code is the quick signal — `0` = uploaded; non-zero = failed: `1` other/unmapped error, `2` malformed `scrapId` (not a 24-char hex ObjectId — usage error) or an unsupported `-f` file extension, `3` not logged in / expired-or-invalid token (401), `4` wrong `scrapId` (404), `5` network. Since @trawlme/cli 1.21.0, `banner` also accepts `--json`: on success it prints the full updated scrap object (same shape as `trawl scraps get <id> --json`), not just an upload receipt. Prefer `$?` for a quick pass/fail check; add `--json` when the caller needs the scrap object itself.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
trawl scraps banner ${scrapId} -f /tmp/${siteName}-banner.png --json
|
|
112
|
+
```
|
|
109
113
|
|
|
110
114
|
## Conventions
|
|
111
115
|
|