@trawlme/skills 1.3.4 → 1.4.1
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 +1 -1
- package/skills/trawl-cli/SKILL.md +20 -1
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; 300000 for `scraps run`, `data --fresh`,
|
|
42
|
+
- `TRAWL_TIMEOUT` — per-request fetch timeout in ms (default 30000; 300000 for `scraps run`, `data --fresh`, `trigger --wait` since CLI 1.18.4, and `create` since 2.0.0 — these hit the server-side scrap-execute/AI-wizard paths, which legitimately run 30-250s; this env var still overrides that longer default too, higher or lower — beware: a low global value clamps `create` and triggers the duplicate-on-retry trap described below)
|
|
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)`.
|
|
@@ -48,6 +48,25 @@ CI-relevant env vars. The first three are per-invocation session overrides — t
|
|
|
48
48
|
|
|
49
49
|
All commands accept `--json` (where listed) for machine-readable or pipeable output.
|
|
50
50
|
|
|
51
|
+
Since CLI **v2.0.0** the agent-facing verbs are also top-level: `trawl list / get / run / data / history / run-info / trigger / whoami / ping / create` (the `trawl scraps <verb>` paths below still work as aliases — zero breaking change, except `trawl fetch`, removed in 2.0.0, see the AI-wizard `create` below which replaced it).
|
|
52
|
+
|
|
53
|
+
### Create a scrap from a URL + a prompt (AI wizard — the flagship)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
trawl create https://example.com/products --prompt "track product prices"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Optional flags: `--no-autofix` (skip the auto-fix retry on a failed first run), `--json` (raw API payload on stdout).
|
|
60
|
+
|
|
61
|
+
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
|
+
Critical semantics for agents:
|
|
64
|
+
- **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.
|
|
65
|
+
- **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
|
+
- **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
|
+
- **`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`.
|
|
68
|
+
- Distinct from `trawl scraps create` below (raw Puppeteer script, no AI).
|
|
69
|
+
|
|
51
70
|
### List scraps
|
|
52
71
|
|
|
53
72
|
```bash
|