pub struct CliApprovalHandler {
pub auto_approve: bool,
pub timeout_secs: u64,
}Expand description
Implements the apcore ApprovalHandler protocol so SDK consumers can pass
a CLI-backed handler to executor.set_approval_handler(handler).
request_approval and check_approval return ApprovalResult for
cross-SDK protocol parity (D10-006). The standalone module-level
check_approval / check_approval_with_timeout continue to return
Result<(), ApprovalError> for callers that prefer typed-error
semantics in pure Rust code.
Fields§
§auto_approve: boolAuto-approve without prompting the user.
timeout_secs: u64Maximum seconds to wait for interactive approval (0 = wait indefinitely).
Implementations§
Source§impl CliApprovalHandler
impl CliApprovalHandler
Sourcepub async fn request_approval(&self, module_def: &Value) -> ApprovalResult
pub async fn request_approval(&self, module_def: &Value) -> ApprovalResult
Request approval for a module, using the CLI interactive prompt.
Returns an ApprovalResult matching the Python/TS protocol shape:
Approved/auto_approve for the --yes flag bypass,
Approved/env_auto_approve for APCORE_CLI_AUTO_APPROVE=1,
Approved/tty_user for an interactive yes,
Rejected for non-TTY or user denial,
Timeout when the prompt window expires.
Mirrors the bypass-priority and message logic of
check_approval_with_tty_timeout but folded into the protocol-shape
return path.
Sourcepub async fn check_approval(&self, module_def: &Value) -> ApprovalResult
pub async fn check_approval(&self, module_def: &Value) -> ApprovalResult
Alias for [request_approval] (matches the Python / TypeScript
check_approval method name on the handler).