pub async fn check_approval(
module_def: &Value,
auto_approve: bool,
) -> Result<(), ApprovalError>Expand description
Gate module execution behind an interactive approval prompt.
Returns Ok(()) immediately if requires_approval is not true.
Bypasses the prompt if auto_approve is true or the env var
APCORE_CLI_AUTO_APPROVE is set to exactly "1".
Returns Err(ApprovalError::NonInteractive) if stdin is not a TTY.
Otherwise prompts the user with a 60-second timeout.
ยงErrors
ApprovalError::NonInteractiveโ stdin is not an interactive terminalApprovalError::Deniedโ user typed anything other thany/yesApprovalError::Timeoutโ prompt timed out