feat: add utility action suites
CI / validate (push) Successful in 36s

This commit is contained in:
2026-07-21 11:38:11 -05:00
parent 52c56f7fed
commit f1a8bb0f35
15 changed files with 1117 additions and 42 deletions
+29 -1
View File
@@ -21,6 +21,9 @@ cargo run -- dictionary generate
cargo run -- serve
cargo run -- query "log hello from codex"
cargo run -- run logger --payload '{"message":"hello from direct dispatch"}'
cargo run -- run calculate --payload '{"expression":"2 + 2 * 3"}'
cargo run -- run to_slug --payload '{"text":"Hello, World!"}'
cargo run -- run write_note --payload '{"filename":"hello.txt","content":"hello"}'
scripts/precommit-check.sh
```
@@ -67,7 +70,32 @@ Malformed JSON, missing action codes, stale versions/checksums, aliases, and unk
## Initial Script
The first registered script is `logger`. It writes JSONL records to `logs/controller-actions.jsonl`. Dispatch is detached: after the controller spawns the script process, it does not monitor completion.
The first registered script was `logger`. It writes JSONL records to `logs/controller-actions.jsonl`. Dispatch is detached: after the controller spawns the script process, it does not monitor completion.
## Action Suites
Math & Conversion:
- `calculate`: `{ "expression": "2 + 2 * 3" }`
- `convert_units`: `{ "value": 100, "from": "km", "to": "miles" }`
- `generate_uuid`: `{}`
- `random_number`: `{ "min": 1, "max": 100 }`
Text Utilities:
- `count_words`: `{ "text": "..." }`
- `to_slug`: `{ "text": "..." }`
- `hash_string`: `{ "text": "...", "algorithm": "sha256|md5|sha1" }`
- `truncate_text`: `{ "text": "...", "max_chars": 100 }`
File Operations:
- `write_note`: `{ "filename": "...", "content": "..." }`
- `append_to_file`: `{ "filename": "...", "content": "..." }`
- `read_file`: `{ "filename": "..." }`
- `delete_file`: `{ "filename": "..." }`
File operations are confined to project-local `notes/` and reject absolute paths or path traversal.
## CI And Hooks