* Native Rust rewrite of agent-browser daemon Single-binary Rust implementation replacing the Node.js/Playwright daemon with direct CDP (Chrome DevTools Protocol) communication. Includes full command parity, WebDriver/Safari/iOS backend routing, request tracking, frame context management, CDP protocol codegen, and comprehensive tests. * improvements * fix ci * fixes * faster builds
16 lines
503 B
Rust
16 lines
503 B
Rust
/// Check if a session name is valid (alphanumeric, hyphens, and underscores only)
|
|
pub fn is_valid_session_name(name: &str) -> bool {
|
|
!name.is_empty()
|
|
&& name
|
|
.chars()
|
|
.all(|c| c.is_alphanumeric() || c == '-' || c == '_')
|
|
}
|
|
|
|
/// Generate error message for invalid session name
|
|
pub fn session_name_error(name: &str) -> String {
|
|
format!(
|
|
"Invalid session name '{}'. Only alphanumeric characters, hyphens, and underscores are allowed.",
|
|
name
|
|
)
|
|
}
|