style: cargo fmt --all — make codebase rustfmt-clean
Some checks failed
Build and Test / Build Server (Linux) (push) Failing after 2m59s
Build and Test / Build Agent (Windows) (push) Has started running
Build and Test / Security Audit (push) Has been cancelled
Build and Test / Build Summary (push) Has been cancelled
Run Tests / Test Server (push) Has been cancelled
Run Tests / Test Agent (push) Has been cancelled
Run Tests / Code Coverage (push) Has been cancelled
Run Tests / Lint and Format Check (push) Has been cancelled

First run of the build-and-test CI gate (cargo fmt --all -- --check) surfaced
pre-existing formatting drift across the agent and server crates. Apply rustfmt
across the workspace so the codebase meets its own CI gate. Pure formatting; no
logic changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-29 15:02:12 +00:00
parent f2e0456f8d
commit 1c5c1e78e7
48 changed files with 1174 additions and 797 deletions

View File

@@ -92,16 +92,18 @@ pub mod build_info {
use anyhow::Result;
use clap::{Parser, Subcommand};
use tracing::{info, error, warn, Level};
use tracing::{error, info, warn, Level};
use tracing_subscriber::FmtSubscriber;
#[cfg(windows)]
use windows::Win32::UI::WindowsAndMessaging::{MessageBoxW, MB_OK, MB_ICONINFORMATION, MB_ICONERROR};
#[cfg(windows)]
use windows::core::PCWSTR;
#[cfg(windows)]
use windows::Win32::System::Console::{AllocConsole, GetConsoleWindow};
#[cfg(windows)]
use windows::Win32::UI::WindowsAndMessaging::{
MessageBoxW, MB_ICONERROR, MB_ICONINFORMATION, MB_OK,
};
#[cfg(windows)]
use windows::Win32::UI::WindowsAndMessaging::{ShowWindow, SW_SHOW};
/// GuruConnect Remote Desktop
@@ -140,7 +142,11 @@ enum Commands {
session_id: String,
/// Server URL
#[arg(short, long, default_value = "wss://connect.azcomputerguru.com/ws/viewer")]
#[arg(
short,
long,
default_value = "wss://connect.azcomputerguru.com/ws/viewer"
)]
server: String,
/// API key for authentication
@@ -177,15 +183,27 @@ fn main() -> Result<()> {
let cli = Cli::parse();
// Initialize logging
let level = if cli.verbose { Level::DEBUG } else { Level::INFO };
let level = if cli.verbose {
Level::DEBUG
} else {
Level::INFO
};
FmtSubscriber::builder()
.with_max_level(level)
.with_target(true)
.with_thread_ids(true)
.init();
info!("GuruConnect {} ({})", build_info::short_version(), build_info::BUILD_TARGET);
info!("Built: {} | Commit: {}", build_info::BUILD_TIMESTAMP, build_info::GIT_COMMIT_DATE);
info!(
"GuruConnect {} ({})",
build_info::short_version(),
build_info::BUILD_TARGET
);
info!(
"Built: {} | Commit: {}",
build_info::BUILD_TIMESTAMP,
build_info::GIT_COMMIT_DATE
);
// Handle post-update cleanup
if cli.post_update {
@@ -194,21 +212,18 @@ fn main() -> Result<()> {
}
match cli.command {
Some(Commands::Agent { code }) => {
run_agent_mode(code)
}
Some(Commands::View { session_id, server, api_key }) => {
run_viewer_mode(&server, &session_id, &api_key)
}
Some(Commands::Install { user_only, elevated }) => {
run_install(user_only || elevated)
}
Some(Commands::Uninstall) => {
run_uninstall()
}
Some(Commands::Launch { url }) => {
run_launch(&url)
}
Some(Commands::Agent { code }) => run_agent_mode(code),
Some(Commands::View {
session_id,
server,
api_key,
}) => run_viewer_mode(&server, &session_id, &api_key),
Some(Commands::Install {
user_only,
elevated,
}) => run_install(user_only || elevated),
Some(Commands::Uninstall) => run_uninstall(),
Some(Commands::Launch { url }) => run_launch(&url),
Some(Commands::VersionInfo) => {
// Show detailed version info (allocate console on Windows for visibility)
#[cfg(windows)]
@@ -341,7 +356,10 @@ fn run_install(force_user_install: bool) -> Result<()> {
match install::install(force_user_install) {
Ok(()) => {
show_message_box("GuruConnect", "Installation complete!\n\nYou can now use guruconnect:// links.");
show_message_box(
"GuruConnect",
"Installation complete!\n\nYou can now use guruconnect:// links.",
);
Ok(())
}
Err(e) => {
@@ -467,7 +485,11 @@ async fn run_agent(config: config::Config) -> Result<()> {
}
// Create tray icon
let tray = match tray::TrayController::new(&hostname, config.support_code.as_deref(), is_support_session) {
let tray = match tray::TrayController::new(
&hostname,
config.support_code.as_deref(),
is_support_session,
) {
Ok(t) => {
info!("Tray icon created");
Some(t)
@@ -503,7 +525,10 @@ async fn run_agent(config: config::Config) -> Result<()> {
t.update_status("Status: Connected");
}
if let Err(e) = session.run_with_tray(tray.as_ref(), chat_ctrl.as_ref()).await {
if let Err(e) = session
.run_with_tray(tray.as_ref(), chat_ctrl.as_ref())
.await
{
let error_msg = e.to_string();
if error_msg.contains("USER_EXIT") {
@@ -515,7 +540,10 @@ async fn run_agent(config: config::Config) -> Result<()> {
if error_msg.contains("SESSION_CANCELLED") {
info!("Session was cancelled by technician");
cleanup_on_exit();
show_message_box("Support Session Ended", "The support session was cancelled.");
show_message_box(
"Support Session Ended",
"The support session was cancelled.",
);
return Ok(());
}
@@ -524,7 +552,10 @@ async fn run_agent(config: config::Config) -> Result<()> {
if let Err(e) = startup::uninstall() {
warn!("Uninstall failed: {}", e);
}
show_message_box("Remote Session Ended", "The session was ended by the administrator.");
show_message_box(
"Remote Session Ended",
"The session was ended by the administrator.",
);
return Ok(());
}
@@ -533,7 +564,10 @@ async fn run_agent(config: config::Config) -> Result<()> {
if let Err(e) = startup::uninstall() {
warn!("Uninstall failed: {}", e);
}
show_message_box("GuruConnect Removed", "This computer has been removed from remote management.");
show_message_box(
"GuruConnect Removed",
"This computer has been removed from remote management.",
);
return Ok(());
}
@@ -551,7 +585,10 @@ async fn run_agent(config: config::Config) -> Result<()> {
if error_msg.contains("cancelled") {
info!("Support code was cancelled");
cleanup_on_exit();
show_message_box("Support Session Cancelled", "This support session has been cancelled.");
show_message_box(
"Support Session Cancelled",
"This support session has been cancelled.",
);
return Ok(());
}