@trawlme/skills 1.4.0 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trawlme/skills",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Claude Code skills for the Trawl CLI — teaches Claude how to manage scraps via @trawlme/cli",
5
5
  "type": "module",
6
6
  "bin": {
@@ -53,15 +53,20 @@ Since CLI **v2.0.0** the agent-facing verbs are also top-level: `trawl list / ge
53
53
  ### Create a scrap from a URL + a prompt (AI wizard — the flagship)
54
54
 
55
55
  ```bash
56
- trawl create https://example.com/products --prompt "track product prices" [--no-autofix] [--json]
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
 
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.
61
+
59
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 }`.
60
63
 
61
64
  Critical semantics for agents:
65
+ - **Ask the user before running it** — `trawl create` sends the URL + prompt to Trawl, creates a persistent scrap, enables a DAILY schedule, and consumes quota (LLM generation + a real run). Obtain explicit user confirmation immediately before executing; never fire it speculatively.
62
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.
63
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`).
64
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.
65
70
  - Distinct from `trawl scraps create` below (raw Puppeteer script, no AI).
66
71
 
67
72
  ### List scraps
@@ -265,7 +270,8 @@ trawl scraps run <id> --watch
265
270
 
266
271
  ## Other commands
267
272
 
268
- - `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`.
269
275
  - `trawl logout` — clear stored credentials
270
276
  - `trawl skills list/install/uninstall/update` — manage the bundled Claude Code skills (this package)
271
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:** `banner` has **no `--json` mode** — the exit code is the only machine-readable signal. `0` = uploaded; non-zero = failed: `1` other/unmapped error, `2` malformed `scrapId` (not a 24-char hex ObjectId — usage error), `3` not logged in / expired-or-invalid token (401), `4` wrong `scrapId` (404), `5` network. Check `$?`, don't parse stdout for success/failure.
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