use std::time::Duration;
pub(super) const BRP_DEFAULT_HOST: &str = "127.0.0.1";
pub(super) const BRP_EXTRAS_PREFIX: &str = "brp_extras/";
pub(super) const BRP_HTTP_PROTOCOL: &str = "http";
pub(super) const BRP_JSONRPC_PATH: &str = "/jsonrpc";
pub(super) const ERROR_BODY_PREVIEW_CHARS: usize = 500;
pub(super) const HTTP_CONTENT_TYPE_JSON: &str = "application/json";
pub(super) const HTTP_HEADER_CONTENT_TYPE: &str = "Content-Type";
pub(super) const HTTP_REQUEST_TIMEOUT: Duration = std::time::Duration::from_secs(30);
pub(super) const BRP_ERROR_ACCESS_ERROR: i32 = -23_501;
pub(super) const BRP_ERROR_CODE_UNKNOWN_COMPONENT_TYPE: i32 = -23_402;
pub(super) const JSON_RPC_ERROR_INTERNAL_ERROR: i32 = -32_603;
pub(super) const JSON_RPC_ERROR_INVALID_PARAMS: i32 = -32_602;
pub const JSON_RPC_ERROR_METHOD_NOT_FOUND: i32 = -32_601;
pub(super) const ERROR_PATTERNS: &[&str] = &[
r"Unknown component type: `([^`]+)`",
r"([a-zA-Z0-9_:]+) is invalid:",
];
pub(super) const FORMAT_ERROR_HELP_FIELD: &str = "help";
pub(super) const FORMAT_ERROR_HELP_MESSAGE: &str = "Unable to determine specific types that failed. Use the brp_type_guide tool to get spawn/insert/mutation information for the types you're working with.";
pub(super) const FORMAT_ERROR_ORIGINAL_ERROR_FIELD: &str = "original_error";
pub(super) const FORMAT_ERROR_SUGGESTED_ACTION: &str =
"Check your BRP method parameters and ensure they match expected structure";
pub(super) const FORMAT_ERROR_SUGGESTED_ACTION_FIELD: &str = "suggested_action";
pub(super) const FORMAT_ERROR_TYPE_GUIDE_FIELD: &str = "type_guide";
pub(super) const JSONRPC_DEFAULT_ID: u64 = 1;
pub(super) const JSONRPC_FIELD: &str = "jsonrpc";
pub(super) const JSONRPC_FIELD_ID: &str = "id";
pub(super) const JSONRPC_FIELD_METHOD: &str = "method";
pub(super) const JSONRPC_FIELD_PARAMS: &str = "params";
pub(super) const JSONRPC_VERSION: &str = "2.0";