May 17, 2026, 11:40 PM

This commit is contained in:
Paweł Domański
2026-05-18 06:40:19 +00:00
commit 64944cf004
896 changed files with 310709 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
---
name: my-suite-transform
description: Deterministic transformations with a strict command allowlist (exec is optional and constrained).
user-invocable: false
metadata: {"openclaw":{"emoji":"🧪","requires":{"config":["group:runtime"],"bins":["jq"]}}}
---
# Transform (Allowlisted exec)
## Golden rule
Preferuj transformacje bez `exec`. Jeśli `exec` jest potrzebny → tylko allowlista poniżej.
## Command allowlist (STRICT)
Dozwolone są WYŁĄCZNIE te komendy (dokładne wzorce):
1) `jq --version`
2) `jq -c . <INPUT >OUTPUT`
3) `jq -r . <INPUT >OUTPUT`
4) `head -n <N> <INPUT`
5) `tail -n <N> <INPUT`
6) `wc -l <INPUT`
7) `grep -n "<literal>" <INPUT`
8) `sed -n '<start>,<end>p' <INPUT`
### Constraints (MUST)
- `<INPUT>` i `<OUTPUT>` MUSZĄ być ścieżkami pod `{baseDir}/runs/<runId>/`
- `<N>` to liczba 1..500
- `"<literal>"` nie może zawierać znaków: `; | & $ \` ( ) { }`
- Zakaz: `rm`, `mv`, `cp` poza run, `curl`, `wget`, `ssh`, `sudo`, `chmod`, `chown`, `dd`, `mkfs`, `> /dev/*` itd.
## Execution steps
1) Waliduj, czy polecenie pasuje do allowlisty i constraintów.
2) Jeśli nie pasuje → przerwij i zaproponuj alternatywę bez exec.
3) Jeśli pasuje → uruchom `exec` tylko na plikach w katalogu run.
4) Wynik zapisz do:
- `{baseDir}/runs/<runId>/transform.log`
- `{baseDir}/runs/<runId>/<output files>`
## Why this exists
Zapobiega command injection i ogranicza skutki błędów do sandboxowego katalogu run.