feat: add safe cap call output modes
This commit is contained in:
@@ -43,8 +43,8 @@ clear operator feedback before adding more architecture.
|
||||
- Completed: bounded RPC CLI smoke runbook with cleanup commands:
|
||||
[`RPC CLI smoke runbook`](runbooks/rpc-cli-smoke.md).
|
||||
- Next docs/ergonomics cleanup: make `cap call` output safer for humans without
|
||||
changing default JSON semantics. Active plan:
|
||||
[`cap call output safety`](superpowers/plans/2026-06-09-cap-call-output-safety.md).
|
||||
changing default JSON semantics. Implementation:
|
||||
[`cap call output safety`](historical/superpowers/plans/2026-06-09-cap-call-output-safety.md).
|
||||
- Future smoke automation: turn the manual RPC CLI smoke runbook into a small
|
||||
script once the command sequence stabilizes.
|
||||
- Keep status read-only; do not mutate registry, auth, config, or stores.
|
||||
|
||||
@@ -80,6 +80,14 @@ Expected:
|
||||
- `outcome` is `ok`.
|
||||
- Output is small and machine-readable.
|
||||
|
||||
Optionally, test compact output:
|
||||
|
||||
```bash
|
||||
uv run wf --config wf.config.json cap call wf.std.constant --input '{"value":"smoke"}' --format compact
|
||||
```
|
||||
|
||||
Expected: one bounded line with `outcome=ok`.
|
||||
|
||||
Avoid using arbitrary MCP tools here unless their output shape is known. MCP
|
||||
content-block envelopes can be large and should not be treated like compact
|
||||
workflow output.
|
||||
|
||||
@@ -175,6 +175,24 @@ wf cap call wf.std.constant --input '{"value": "hello"}'
|
||||
wf --url http://127.0.0.1:8765/rpc cap call everything.default.echo --input '{"message": "hello"}'
|
||||
```
|
||||
|
||||
Use `--format compact` for a bounded one-line summary that avoids dumping large
|
||||
MCP content-block envelopes:
|
||||
|
||||
```bash
|
||||
wf cap call wf.std.constant --input '{"value": "hello"}' --format compact
|
||||
```
|
||||
|
||||
Use `--format text --unwrap-text` to extract exactly one MCP text content block.
|
||||
This mode refuses images, resources, blobs, multiple content blocks, and
|
||||
non-MCP output:
|
||||
|
||||
```bash
|
||||
wf cap call everything.default.echo --input '{"message": "hello"}' --format text --unwrap-text
|
||||
```
|
||||
|
||||
Use `--max-output-chars N` to bound compact/text terminal output. JSON output
|
||||
is never truncated.
|
||||
|
||||
`cap call` is an authoring/runtime smoke test. It uses the same local or remote
|
||||
target selection as the rest of the CLI and returns a normalized outcome,
|
||||
output, source id, and diagnostics. Use it to confirm payload shape and upstream
|
||||
|
||||
Reference in New Issue
Block a user