MCPcopy Create free account
hub / github.com/AI45Lab/Code / parse_timeout_action

Function parse_timeout_action

sdk/node/src/lib.rs:2641–2656  ·  view source on GitHub ↗
(value: Option<&str>)

Source from the content-addressed store, hash-verified

2639}
2640
2641fn parse_timeout_action(value: Option<&str>) -> napi::Result<RustTimeoutAction> {
2642 match value
2643 .unwrap_or("reject")
2644 .trim()
2645 .to_ascii_lowercase()
2646 .replace('-', "_")
2647 .as_str()
2648 {
2649 "reject" => Ok(RustTimeoutAction::Reject),
2650 "auto_approve" | "autoapprove" => Ok(RustTimeoutAction::AutoApprove),
2651 other => Err(napi::Error::from_reason(format!(
2652 "Invalid confirmation timeoutAction '{}'. Must be: reject or auto_approve",
2653 other
2654 ))),
2655 }
2656}
2657
2658fn js_confirmation_policy_to_rust(
2659 policy: ConfirmationPolicy,

Callers 1

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected