@trawlme/skills 1.4.5 → 1.4.6
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
|
@@ -143,8 +143,8 @@ trawl scraps update <id> --alert ops@example.com # email on failure
|
|
|
143
143
|
trawl scraps update <id> --no-alert # disable alerts
|
|
144
144
|
trawl scraps update <id> --autofix # enable AI Fix (auto-repair on failure) — @trawlme/cli@1.11.0+
|
|
145
145
|
trawl scraps update <id> --no-autofix # disable AI Fix
|
|
146
|
-
trawl scraps update <id> -p '[{"TRAWL.page":"2"}]' #
|
|
147
|
-
trawl scraps update <id> --params-file ./params.json #
|
|
146
|
+
trawl scraps update <id> -p '[{"TRAWL.page":"2"}]' # scenarios: JSON array of param sets, e.g. [{"TRAWL.<name>":"<value>"}]
|
|
147
|
+
trawl scraps update <id> --params-file ./params.json # scenarios from a file (same array shape)
|
|
148
148
|
trawl scraps update <id> --tier tier2 # request a proxy tier
|
|
149
149
|
trawl scraps update <id> --force-tier tier4 # raise the tier CEILING past the auto-cap
|
|
150
150
|
trawl scraps update <id> --tier tier2 --json # full scrap JSON, or error envelope + exit 1 on refusal
|
|
@@ -152,6 +152,14 @@ trawl scraps update <id> --tier tier2 --json # full scrap JSON, o
|
|
|
152
152
|
|
|
153
153
|
> **GTM seed scraps:** always run `trawl scraps update <id> --autofix --cron '0 0 * * 0'` post-create (weekly schedule + AI Fix enabled).
|
|
154
154
|
|
|
155
|
+
### Params are scenarios
|
|
156
|
+
|
|
157
|
+
- Params stored on a scrap (`-p` / `--params-file`) are **scenarios**: an array of param sets. Each scheduled, dashboard or `trawl run` run picks **one set at random** — never "the last saved set". Put everything a run needs in each set; sets are alternatives, not additions.
|
|
158
|
+
- To run with your own values instead, use `trawl trigger <id> --param key=value` (repeatable). It is a one-off run: the stored scenarios are left untouched. **Since CLI 3.15.0** — currently on the npm `next` dist-tag (`npm i -g @trawlme/cli@next`), not yet on `latest` (3.12.7).
|
|
159
|
+
- Rules: the first stored set defines the schema. Keys are that set's keys, `TRAWL.` prefix optional. Values are typed like the stored value: number, `true`/`false`, or string. Every key is required; blank values and unknown, duplicate or wrongly typed keys are refused with exit 2 (a number error says `must be a number`, a boolean one `must be true or false`; unknown or missing keys list the expected keys). Works with `--wait`, `--watch` and the async default.
|
|
160
|
+
- A scrap without stored params takes no `--param`. A scrap that has params and is triggered without `--param` fails (422 under `--wait`; async, it is acked as queued and the run then fails).
|
|
161
|
+
- `--param` reads the scrap first, so an API key needs `trawl:scraps:read` besides `trawl:scraps:run`. On a scrap without a cron, `trigger` prints a stderr warning that nothing runs it unattended.
|
|
162
|
+
|
|
155
163
|
### Proxy tiers
|
|
156
164
|
|
|
157
165
|
- `--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.
|
|
@@ -167,6 +175,7 @@ trawl scraps update <id> --tier tier2 --json # full scrap JSON, o
|
|
|
167
175
|
- `trawl scraps run <id> --watch` — same, then polls for progress (since CLI 1.18.4 — see below; it does **not** stream)
|
|
168
176
|
- `trawl scraps trigger <id>` — **async by default**: queues the worker run and returns immediately (no waiting on the 30-250s run)
|
|
169
177
|
- `trawl scraps trigger <id> --wait` — synchronous: block until the run completes (legacy behaviour). Same 300s timeout as `run`, since CLI 1.18.4.
|
|
178
|
+
- `trawl scraps trigger <id> --param key=value` — one-off run with your own param values, see "Params are scenarios" (CLI 3.15.0+, `next` tag)
|
|
170
179
|
- `trawl scraps trigger <id> --watch` — queue, then poll for progress (since CLI 1.18.4 — see below; it does **not** stream)
|
|
171
180
|
- `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.
|
|
172
181
|
|
|
@@ -81,9 +81,10 @@ returnData([
|
|
|
81
81
|
## Params
|
|
82
82
|
|
|
83
83
|
- **`TRAWL.url`** — the target URL, set by the scrap schedule. Treat as immutable; never override it.
|
|
84
|
-
- **`TRAWL.<custom>`** —
|
|
85
|
-
-
|
|
86
|
-
- **`
|
|
84
|
+
- **`TRAWL.<custom>`** — a custom parameter of the run. Where it comes from: the scrap's stored params (Settings → Parameters, or `trawl scraps update <id> -p/--params '[{"TRAWL.<name>":"<value>"}]'`, or `--params-file <path>` for bulk — see the `trawl-cli` skill) or the caller's own values (`trawl trigger <id> --param name=value`, CLI 3.15.0+, npm `next` tag for now).
|
|
85
|
+
- **Stored params are scenarios.** The array holds alternative param sets, and each scheduled, dashboard or `trawl run` run receives **one set picked at random**. The script never sees the whole array, so every set must carry every key the script needs. A `--param` run replaces the pick with the caller's values for that run only.
|
|
86
|
+
- **`RANDOM(...)`** — a value generator, unrelated to the scenario pick above: a helper that returns a random value from a list (see Trawl params docs). *Signature not independently re-verified against the worker runtime as part of this pass — treat as provisional.*
|
|
87
|
+
- **`DATE(±N, unit, format)`** — a value generator too: a date helper that returns a formatted date offset from now. *Signature not independently re-verified against the worker runtime as part of this pass — treat as provisional.*
|
|
87
88
|
|
|
88
89
|
Validate inputs early — throw before any network call if a required param is missing.
|
|
89
90
|
|