Skip to main content

validate_command_token

Function validate_command_token 

Source
pub fn validate_command_token(command: &str) -> Result<(), String>
Expand description

Validate a stdio command as a single executable token.

Accepts either a bare executable name (no /, \, or whitespace, resolved via platform search) or a plugin-relative ./ path (resolved against the plugin root; spaces allowed since spawn is argv-based). Rejects empty values, bare directory tokens (./, ./.), NUL/newlines, and shell-control characters so a shell command string can never slip through as one token (Agent Plugins ยง7.2.1: single token, bare or ./).