@trawlme/skills 1.4.7 → 1.4.8
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
|
@@ -155,7 +155,7 @@ trawl scraps update <id> --tier tier2 --json # full scrap JSON, o
|
|
|
155
155
|
### Params are scenarios
|
|
156
156
|
|
|
157
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
|
|
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.**
|
|
159
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
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 exits 0, then the run is dropped with no history row, and `--watch` polls until its 660s timeout, then prints "Timed out waiting for the run to finish" and exits 1; use `--wait` to see the error).
|
|
161
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.
|
|
@@ -175,7 +175,7 @@ trawl scraps update <id> --tier tier2 --json # full scrap JSON, o
|
|
|
175
175
|
- `trawl scraps run <id> --watch` — same, then polls for progress (since CLI 1.18.4 — see below; it does **not** stream)
|
|
176
176
|
- `trawl scraps trigger <id>` — **async by default**: queues the worker run and returns immediately (no waiting on the 30-250s run)
|
|
177
177
|
- `trawl scraps trigger <id> --wait` — synchronous: block until the run completes (legacy behaviour). Same timeout as `run` (660s since CLI 3.12.6).
|
|
178
|
-
- `trawl scraps trigger <id> --param key=value` — one-off run with your own param values, see "Params are scenarios" (CLI 3.15.0
|
|
178
|
+
- `trawl scraps trigger <id> --param key=value` — one-off run with your own param values, see "Params are scenarios" (CLI 3.15.0+)
|
|
179
179
|
- `trawl scraps trigger <id> --watch` — queue, then poll for progress (since CLI 1.18.4 — see below; it does **not** stream)
|
|
180
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.
|
|
181
181
|
|
|
@@ -81,7 +81,7 @@ 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>`** — 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
|
|
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+). An on-demand run (`trawl trigger`, the public API, MCP) receives the caller's values instead of a stored set, limited to the keys of the FIRST stored set. Either way the script sees one flat value per key, never the array.
|
|
85
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, and every set must use the same keys as set 0. A `--param` run replaces the pick with the caller's values for that run only.
|
|
86
86
|
- **Value generators** (written as a param VALUE and resolved server-side on every run before the script starts; the script only reads `TRAWL.<name>`). They are unrelated to the random pick of the stored set above.
|
|
87
87
|
- `RANDOM(a,b,c)` returns one of the comma-separated values, e.g. `{"TRAWL.city":"RANDOM(paris,lyon)"}`. Values are not trimmed, so `RANDOM(a, b)` can yield `" b"`: write no spaces.
|