Auto-install protocol handler when exe run without args

This commit is contained in:
2025-12-30 06:06:51 -07:00
parent 1b810a5f0a
commit 9f36686ea1
2 changed files with 54 additions and 3 deletions

View File

@@ -138,9 +138,15 @@ fn main() -> Result<()> {
if let Some(code) = cli.support_code {
run_agent_mode(Some(code))
} else {
// No args: check if we should auto-detect mode
// For now, default to agent mode
run_agent_mode(None)
// No args: check if protocol handler is installed
// If not, run install mode (user likely downloaded from web)
if !install::is_protocol_handler_registered() {
info!("Protocol handler not registered, running installer");
run_install(false)
} else {
// Protocol handler exists, run as agent
run_agent_mode(None)
}
}
}
}