Expand description
Agent-First Data (AFDATA) output formatting and protocol templates.
21 public APIs and 5 types (+ 2 optional help renderers):
- 3 protocol builders:
build_json_ok,build_json_error,build_json - 3 redacted value helpers:
redacted_value,redacted_value_with,redacted_value_with_options - 7 output formatters:
output_json,output_json_with,output_json_with_options,output_yaml,output_yaml_with_options,output_plain,output_plain_with_options - 2 redaction utilities:
internal_redact_secrets,internal_redact_secrets_with_options - 1 parse utility:
parse_size - 5 CLI helpers:
cli_parse_output,cli_parse_log_filters,cli_output,cli_output_with_options,build_cli_error - 5 types:
OutputFormat,RedactionPolicy,RedactionOptions,OutputStyle,OutputOptions - (feature
cli-help): [cli_render_help] — recursive plain-text help for clap commands - (feature
cli-help-markdown): [cli_render_help_markdown] — recursive Markdown help
Structs§
- Output
Options - Output options combining redaction and rendering style.
- Redaction
Options - Redaction options for legacy secret field names.
Enums§
- Output
Format - Output format for CLI and pipe/MCP modes.
- Output
Style - Rendering style for YAML and plain output.
- Redaction
Policy - Redaction policy for
output_json_with.
Functions§
- build_
cli_ error - Build a standard CLI parse error value.
- build_
json - Build
{code: "<custom>", ...fields, trace?: ...}. - build_
json_ error - Build
{code: "error", error: message, hint?: ..., trace?: ...}. - build_
json_ ok - Build
{code: "ok", result: ..., trace?: ...}. - cli_
output - Dispatch output formatting by
OutputFormat. - cli_
output_ with_ options - Dispatch output formatting by
OutputFormatwith configurable output options. - cli_
parse_ log_ filters - Normalize
--logflag entries: trim, lowercase, deduplicate, remove empty. - cli_
parse_ output - Parse
--outputflag value intoOutputFormat. - internal_
redact_ secrets - Redact
_secretfields in-place. - internal_
redact_ secrets_ with_ options - Redact secret fields in-place using configurable redaction options.
- output_
json - Format as single-line JSON with full
_secretredaction. - output_
json_ with - Format as single-line JSON with configurable redaction policy.
- output_
json_ with_ options - Format as single-line JSON with configurable output options.
- output_
plain - Format as single-line logfmt. Keys stripped, values formatted, secrets redacted.
- output_
plain_ with_ options - Format as single-line logfmt with configurable output options.
- output_
yaml - Format as multi-line YAML. Keys stripped, values formatted, secrets redacted.
- output_
yaml_ with_ options - Format as multi-line YAML with configurable output options.
- parse_
size - Parse a human-readable size string into bytes.
- redacted_
value - Return a JSON value copy with default
_secretredaction applied. - redacted_
value_ with - Return a JSON value copy with an explicit redaction policy applied.
- redacted_
value_ with_ options - Return a JSON value copy with configurable redaction options applied.