From 166cc43877472b2e46624a0be58e26a8fee3d246 Mon Sep 17 00:00:00 2001 From: Ilya Shcherbak Date: Mon, 16 Nov 2026 16:37:28 +0300 Subject: [PATCH] Add overview onboarding and guided agent setup --- README.md | 38 +++ .../src/agents/desktop_install/mod.rs | 2 +- .../src/agents/desktop_install/running.rs | 73 +++-- crates/wizard-core/src/agents/launch.rs | 225 ++++++++++++++++ crates/wizard-core/src/agents/mod.rs | 3 +- crates/wizard-gui/src/agents.rs | 15 ++ crates/wizard-gui/src/desktop_install.rs | 68 +++-- crates/wizard-gui/src/lib.rs | 1 + crates/wizard-gui/tauri.conf.json | 2 + crates/wizard-gui/wizard-ui/src/App.tsx | 31 ++- .../wizard-gui/wizard-ui/src/AppSidebar.tsx | 13 +- .../src/agents/AgentConfiguration.tsx | 138 ++++++++++ .../wizard-ui/src/agents/AgentPage.tsx | 202 +------------- .../src/agents/PreparedPlanDialog.tsx | 10 +- .../wizard-ui/src/agents/navigation.ts | 5 +- .../wizard-ui/src/assets/logo-wizard.svg | 4 +- .../src/assets/onboarding-interference.png | Bin 0 -> 3721047 bytes .../assets/onboarding-interference.prompt.txt | 9 + .../src/assets/wizard-demo-poster.webp | Bin 0 -> 66658 bytes .../wizard-ui/src/components/AppLogo.tsx | 2 +- .../wizard-ui/src/components/BrandIcons.css | 9 + .../wizard-ui/src/components/BrandIcons.tsx | 1 + .../components/catalyst/sidebar-layout.tsx | 24 +- .../src/onboarding/AgentSelection.tsx | 86 ++++++ .../wizard-ui/src/onboarding/InstallCard.tsx | 189 +++++++++++++ .../wizard-ui/src/onboarding/SetupDialog.css | 65 +++++ .../wizard-ui/src/onboarding/SetupDialog.tsx | 164 +++++++++++ .../wizard-ui/src/onboarding/agents.tsx | 33 +++ .../wizard-ui/src/overview/Overview.css | 254 ++++++++++++++++++ .../wizard-ui/src/overview/Overview.tsx | 114 ++++++++ .../src/overview/OverviewArtwork.tsx | 98 +++++++ .../src/overview/OverviewBackdrop.tsx | 8 + .../wizard-ui/src/overview/OverviewCard.tsx | 156 +++++++++++ .../src/overview/OverviewPenLogo.tsx | 26 ++ .../wizard-ui/src/overview/OverviewVideo.tsx | 36 +++ .../wizard-ui/src/settings/HubSignIn.tsx | 8 +- .../src/settings/SystemProxyPrompt.tsx | 60 +++++ 37 files changed, 1899 insertions(+), 273 deletions(-) create mode 100644 crates/wizard-core/src/agents/launch.rs create mode 100644 crates/wizard-gui/wizard-ui/src/agents/AgentConfiguration.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/assets/onboarding-interference.png create mode 100644 crates/wizard-gui/wizard-ui/src/assets/onboarding-interference.prompt.txt create mode 100644 crates/wizard-gui/wizard-ui/src/assets/wizard-demo-poster.webp create mode 100644 crates/wizard-gui/wizard-ui/src/components/BrandIcons.css create mode 100644 crates/wizard-gui/wizard-ui/src/onboarding/AgentSelection.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/onboarding/InstallCard.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/onboarding/SetupDialog.css create mode 100644 crates/wizard-gui/wizard-ui/src/onboarding/SetupDialog.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/onboarding/agents.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/overview/Overview.css create mode 100644 crates/wizard-gui/wizard-ui/src/overview/Overview.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/overview/OverviewArtwork.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/overview/OverviewBackdrop.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/overview/OverviewCard.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/overview/OverviewPenLogo.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/overview/OverviewVideo.tsx create mode 100644 crates/wizard-gui/wizard-ui/src/settings/SystemProxyPrompt.tsx diff --git a/README.md b/README.md index cc6f445..2aa456e 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,44 @@ The interface reference is the Hub in the neighboring `thinker` repository: `crates/ff-hub/hub-ui/src/modules/App.tsx` (agent order and divider) and `packages/coreinfra-ui/src/hub-sidebar-footer.tsx` (account menu and theme controls). +### Overview and initial setup + +**Обзор** is the default full-window page, above **Агенты** in the sidebar. +The three action cards use the live account and detection state: + +- **Подключите свой аккаунт** becomes the selected hub and account identity after sign-in. +- **Установите агентов** becomes available after sign-in. +- **Настройте агентов** requires sign-in and at least one detected agent. + +On first launch, navigation is hidden. «Пропустить быструю настройку» beside +«Начало работы» reveals it and remembers the choice across launches. Overview +remains accessible from the sidebar. Configuration reuses the regular agent form +and plan confirmation; multiple installed agents always show a selection first. +The final action launches the configured desktop app or CLI. + +Connection options are ordered API access, subscription, then without CoreInfra. +Token selection is automatic: reuse the configured token if it belongs to the +selected Hub, otherwise reuse the oldest token named for the agent, or create one +on confirmation. A note shows its name instead of a selector. Claude Desktop's +subscription uses the existing Wizard proxy-token flow. «Завершить настройку» +opens the change plan and confirms it before the launch step. + +Downloads run in the backend and preserve explicit pauses across dialog closes. +Installing requires a separate «Установить» confirmation; «Отмена» retains the +archive. Installed apps show their version and offer an update check. Completed +installs and checks close with «Готово». + +Choosing a subscription offers to enable the system proxy if it is off. +Only «Включить» changes OS settings; cancel keeps the selected mode. The prompt +does not overwrite another proxy. Disable it in Settings → System proxy. + +The [Wizard demo](https://coreinfra.ru/wizard) loads only after a click; its poster +is local. `coreinfra.ru/assets/wizard/` is allowed in both Tauri media CSPs. +Controls use Catalyst with 14 px text. Card surfaces stay neutral; drawings gain +color on hover/focus. The first account-card hover plays the marker animation +once per launch; newly unlocked steps circle only their buttons. Animations +respect Reduced Motion. + ## License Except where separately noted, CoreInfra Wizard's original source code is licensed under the [Mozilla Public License, v. 2.0](LICENSE). If a copy of the MPL was not distributed with this project, you can obtain one at . diff --git a/crates/wizard-core/src/agents/desktop_install/mod.rs b/crates/wizard-core/src/agents/desktop_install/mod.rs index dfb0e36..d8c5674 100644 --- a/crates/wizard-core/src/agents/desktop_install/mod.rs +++ b/crates/wizard-core/src/agents/desktop_install/mod.rs @@ -6,7 +6,7 @@ mod download; mod running; pub use download::{DownloadProgress, SavedDownload, download_release, saved_download}; -pub use running::{open_first_install, running_apps}; +pub use running::{open_existing, open_first_install, running_apps}; use super::TokenAgent; #[cfg(target_os = "macos")] diff --git a/crates/wizard-core/src/agents/desktop_install/running.rs b/crates/wizard-core/src/agents/desktop_install/running.rs index 2a6fbaa..66cadb7 100644 --- a/crates/wizard-core/src/agents/desktop_install/running.rs +++ b/crates/wizard-core/src/agents/desktop_install/running.rs @@ -4,13 +4,15 @@ //! Wizard only asks applications to quit: an application that refuses or hangs keeps running, //! and the installation then fails as if the user had not agreed to close it. -use super::Target; #[cfg(target_os = "macos")] use super::command_output; +use super::{DesktopApp, Target}; +use crate::agents::{AgentDetection, detection}; #[cfg(target_os = "macos")] use crate::platform::macos::{app_is_running, read_app_info, request_app_quit, running_app_paths}; #[cfg(target_os = "macos")] use core::time::Duration; +use std::path::Path; #[cfg(any(target_os = "macos", target_os = "linux"))] use std::path::PathBuf; #[cfg(target_os = "macos")] @@ -168,7 +170,7 @@ impl Reopen { #[cfg(target_os = "windows")] if self.package && !windows::package_running(&target.app.spec().package) { - match windows::open_package(&target.app.spec().package) { + match windows::open_package(&target.app.spec().package, None) { Ok(()) => log::info!("{} opened again after installation", target.app.product()), Err(error) => report(target.app.product(), &error), } @@ -213,14 +215,33 @@ pub fn open_first_install(target: &Target) -> Option { } } -/// Opens the installed application, or brings it to the front when it already runs. +/// Re-detects before launching: an installer target can name a future path or a different +/// application being replaced. Launch must use the same app that discovery showed in the UI. +/// Call from a Tokio blocking worker. +pub fn open_existing(app: DesktopApp, last_path: Option<&Path>) -> anyhow::Result<()> { + let agent = match app { + DesktopApp::Claude => detection::DesktopAgent::Claude, + DesktopApp::ChatGpt => detection::DesktopAgent::Codex, + }; + match detection::detect_desktop(agent, last_path) { + AgentDetection::Found(info) => open_application(app, Some(&info.path)), + AgentDetection::NotFound => { + anyhow::bail!("Агент больше не найден. Вернитесь к выбору агента.") + } + AgentDetection::Error(error) => anyhow::bail!("Не удалось найти агента: {error}"), + } +} + +/// Opens the just-installed application, or brings it to the front when it already runs. fn open_installed(target: &Target) -> anyhow::Result<()> { + open_application(target.app, target.path.as_deref()) +} + +fn open_application(app: DesktopApp, path: Option<&Path>) -> anyhow::Result<()> { #[cfg(target_os = "macos")] let opened = { - let path = target - .path - .as_deref() - .ok_or_else(|| anyhow::anyhow!("не указан путь установки"))?; + let _ = app; + let path = path.ok_or_else(|| anyhow::anyhow!("не указан путь установки"))?; command_output( Command::new("/usr/bin/open").arg(path), &format!("Не удалось открыть {}", path.display()), @@ -228,17 +249,20 @@ fn open_installed(target: &Target) -> anyhow::Result<()> { .map(drop) }; #[cfg(target_os = "windows")] - let opened = windows::open_package(&target.app.spec().package); + let opened = windows::open_package(&app.spec().package, path); #[cfg(target_os = "linux")] let opened = { - // Installation fails for ChatGPT here, so the launcher is always Claude's. - debug_assert_eq!(target.app, super::DesktopApp::Claude); - linux::open(std::path::Path::new(linux::LAUNCHER), &[]) + let path = match path { + Some(path) => path, + None if app == DesktopApp::Claude => Path::new(linux::LAUNCHER), + None => anyhow::bail!("Не указан путь приложения"), + }; + linux::open(path, &[]) }; #[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "linux")))] let opened = { - let _ = target; - Ok(()) + let _ = (app, path); + anyhow::bail!("Запуск приложения на этой платформе не поддерживается") }; opened } @@ -350,19 +374,30 @@ mod windows { } /// Starts the package's application as the user, like its Start menu entry. - pub(super) fn open_package(package: &WindowsPackage) -> Result<()> { + pub(super) fn open_package( + package: &WindowsPackage, + detected: Option<&std::path::Path>, + ) -> Result<()> { let script = r" $ErrorActionPreference = 'Stop' $package = $env:WIZARD_DESKTOP_PACKAGE | ConvertFrom-Json -$installed = @(Get-AppxPackage -Name $package.name | Where-Object { $_.Publisher -ceq $package.publisher }) -if ($installed.Count -eq 0) { exit 2 } -$application = @((Get-AppxPackageManifest -Package $installed[0].PackageFullName).Package.Applications.Application)[0] -if ($null -eq $application) { exit 3 } -Start-Process -FilePath ('shell:AppsFolder\' + $installed[0].PackageFamilyName + '!' + $application.Id) +$names = @($package.name) +if ($package.path -and $package.name -eq 'Claude') { $names += 'AnthropicPBC.Claude' } +$installed = @(foreach ($name in $names) { Get-AppxPackage -Name $name | Where-Object { $_.Publisher -ceq $package.publisher } }) +foreach ($candidate in ($installed | Sort-Object Version -Descending)) { + $applications = @((Get-AppxPackageManifest -Package $candidate.PackageFullName).Package.Applications.Application) + foreach ($application in $applications) { + if ($package.path -and (Join-Path $candidate.InstallLocation $application.Executable) -ine $package.path) { continue } + Start-Process -FilePath ('shell:AppsFolder\' + $candidate.PackageFamilyName + '!' + $application.Id) + exit 0 + } +} +exit 2 "; let parameters = serde_json::json!({ "name": package.name, "publisher": package.publisher, + "path": detected, }) .to_string(); command_output( diff --git a/crates/wizard-core/src/agents/launch.rs b/crates/wizard-core/src/agents/launch.rs new file mode 100644 index 0000000..c1aca13 --- /dev/null +++ b/crates/wizard-core/src/agents/launch.rs @@ -0,0 +1,225 @@ +//! Open a known agent in its desktop app or an interactive terminal. + +use super::{AgentDetection, desktop_install, detection}; +use anyhow::{Context as _, Result, bail}; +use serde::Deserialize; +use std::path::Path; +use wizard_settings::Settings; + +/// The GUI chooses an agent, never an executable or shell command. +#[derive(Clone, Copy, Debug, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum LaunchAgent { + ClaudeDesktop, + #[serde(rename = "chatgpt")] + ChatGpt, + Claude, + Codex, + #[serde(rename = "opencode")] + OpenCode, + Pi, +} + +/// Must be called in a Tokio blocking worker, as discovery can run a version check. +pub fn launch(agent: LaunchAgent, settings: &Settings) -> Result<()> { + let paths = &settings.last_paths; + let (cli, last_path) = match agent { + LaunchAgent::ClaudeDesktop | LaunchAgent::ChatGpt => { + let (desktop, last_path) = match agent { + LaunchAgent::ClaudeDesktop => ( + desktop_install::DesktopApp::Claude, + paths.claude_desktop.as_deref(), + ), + _ => ( + desktop_install::DesktopApp::ChatGpt, + paths.codex_desktop.as_deref(), + ), + }; + return desktop_install::open_existing(desktop, last_path); + } + LaunchAgent::Claude => (detection::Agent::Claude, paths.claude.as_deref()), + LaunchAgent::Codex => (detection::Agent::Codex, paths.codex.as_deref()), + LaunchAgent::OpenCode => (detection::Agent::OpenCode, paths.opencode.as_deref()), + LaunchAgent::Pi => (detection::Agent::Pi, paths.pi.as_deref()), + }; + match detection::detect(cli, last_path) { + AgentDetection::Found(info) => open_terminal(&info.path), + AgentDetection::NotFound => bail!("Агент больше не найден. Вернитесь к выбору агента."), + AgentDetection::Error(error) => bail!("Не удалось найти агента: {error}"), + } +} + +#[cfg(target_os = "macos")] +fn terminal_line(executable: &Path, directory: &Path) -> Result { + fn quote(path: &Path) -> Result { + let value = path + .to_str() + .context("Путь агента содержит неподдерживаемые символы")?; + Ok(format!("'{}'", value.replace('\'', "'\"'\"'"))) + } + Ok(format!( + "cd -- {} && exec {}", + quote(directory)?, + quote(executable)? + )) +} + +#[cfg(target_os = "macos")] +fn terminal_script(executable: &Path, directory: &Path) -> Result { + // Terminal opens the script through Launch Services, without an Apple Events permission. + // Remove the temporary launcher as soon as Terminal reads it; it contains no credentials. + Ok(format!( + "#!/bin/sh\nrm -f -- \"$0\"\n{}\n", + terminal_line(executable, directory)? + )) +} + +#[cfg(target_os = "macos")] +fn open_terminal(executable: &Path) -> Result<()> { + use core::time::Duration; + use std::{fs, io::Write as _, os::unix::fs::PermissionsExt as _, process::Stdio}; + + let home = dirs::home_dir().context("Не удалось найти домашнюю папку")?; + let mut launcher = tempfile::Builder::new() + .prefix("wizard-agent-") + .suffix(".command") + .tempfile() + .context("Не удалось подготовить запуск агента")?; + launcher.write_all(terminal_script(executable, &home)?.as_bytes())?; + launcher + .as_file() + .set_permissions(fs::Permissions::from_mode(0o700))?; + let (_, path) = launcher + .keep() + .context("Не удалось сохранить команду запуска")?; + let mut command = tokio::process::Command::new("/usr/bin/open"); + command + .args(["-b", "com.apple.Terminal"]) + .arg(&path) + .stdout(Stdio::null()) + .stderr(Stdio::piped()); + let result = crate::platform::command_output(command, Duration::from_secs(30)) + .context("Не удалось открыть Терминал") + .and_then(|output| { + anyhow::ensure!( + output.status.success(), + "Не удалось открыть Терминал. Повторите попытку." + ); + Ok(()) + }); + if result.is_err() { + let _ = fs::remove_file(path); + } + result +} + +#[cfg(target_os = "windows")] +fn open_terminal(executable: &Path) -> Result<()> { + use std::{os::windows::process::CommandExt as _, process::Command}; + use windows_sys::Win32::System::Threading::CREATE_NEW_CONSOLE; + + // A literal environment value avoids interpreting quotes/metacharacters in a path. + let mut command = Command::new("powershell.exe"); + command + .args([ + "-NoLogo", + "-NoProfile", + "-NoExit", + "-Command", + "& $env:WIZARD_LAUNCH_AGENT", + ]) + .env("WIZARD_LAUNCH_AGENT", executable) + .creation_flags(CREATE_NEW_CONSOLE); + if let Some(home) = dirs::home_dir() { + command.current_dir(home); + } + command.spawn().context("Не удалось открыть PowerShell")?; + Ok(()) +} + +#[cfg(target_os = "linux")] +fn open_terminal(executable: &Path) -> Result<()> { + use std::{io::ErrorKind, process::Command}; + + for (terminal, separator) in [ + ("x-terminal-emulator", "-e"), + ("gnome-terminal", "--"), + ("konsole", "-e"), + ("xfce4-terminal", "-x"), + ("xterm", "-e"), + ] { + let mut command = Command::new(terminal); + command.arg(separator).arg(executable); + if let Some(home) = dirs::home_dir() { + command.current_dir(home); + } + match command.spawn() { + Ok(mut child) => { + std::thread::spawn(move || { + let _ = child.wait(); + }); + return Ok(()); + } + Err(error) if error.kind() == ErrorKind::NotFound => {} + Err(error) => return Err(error).context("Не удалось открыть терминал"), + } + } + bail!("Терминал не найден. Установите терминал или запустите агента вручную.") +} + +#[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "linux")))] +fn open_terminal(_: &Path) -> Result<()> { + bail!("Запуск агента на этой платформе не поддерживается") +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn launch_accepts_only_known_agent_ids() { + for id in [ + "claude_desktop", + "chatgpt", + "claude", + "codex", + "opencode", + "pi", + ] { + assert!(serde_json::from_value::(serde_json::json!(id)).is_ok()); + } + for id in [ + "/bin/sh", + "claude --help", + "$(touch /tmp/wizard-launch)", + "open_code", + ] { + assert!(serde_json::from_value::(serde_json::json!(id)).is_err()); + } + } + + #[cfg(target_os = "macos")] + #[test] + fn terminal_paths_are_literal_shell_data() -> Result<()> { + use std::{fs, os::unix::fs::PermissionsExt as _, process::Command}; + let directory = tempfile::tempdir()?; + let workspace = directory.path().join("work ' \" $HOME; $(touch injected)"); + fs::create_dir(&workspace)?; + let executable = directory.path().join("agent ' \" $HOME; $(touch injected)"); + fs::write(&executable, "#!/bin/sh\nprintf 'launched\\n'\npwd\n")?; + fs::set_permissions(&executable, fs::Permissions::from_mode(0o700))?; + let launcher = directory.path().join("wizard.command"); + fs::write(&launcher, terminal_script(&executable, &workspace)?)?; + let output = Command::new("/bin/sh") + .arg(&launcher) + .current_dir(directory.path()) + .output()?; + assert!(output.status.success()); + let text = String::from_utf8(output.stdout)?; + assert_eq!(text, format!("launched\n{}\n", workspace.display())); + assert!(!launcher.exists(), "the temporary command removes itself"); + assert!(!directory.path().join("injected").exists()); + assert!(!workspace.join("injected").exists()); + Ok(()) + } +} diff --git a/crates/wizard-core/src/agents/mod.rs b/crates/wizard-core/src/agents/mod.rs index f850a63..7ac812f 100644 --- a/crates/wizard-core/src/agents/mod.rs +++ b/crates/wizard-core/src/agents/mod.rs @@ -12,6 +12,7 @@ pub mod claude_desktop; pub mod codex; pub mod desktop_install; mod detection; +pub mod launch; pub mod opencode; pub mod pi; @@ -35,7 +36,7 @@ pub enum TokenAgent { impl TokenAgent { /// Name of the Hub token Wizard creates for this agent. Keep in sync with - /// `createdTokenNames` in `wizard-ui/src/agents/AgentList.tsx`. + /// `createdTokenNames` in `wizard-ui/src/agents/AgentConfiguration.tsx`. #[must_use] pub const fn token_name(self) -> &'static str { match self { diff --git a/crates/wizard-gui/src/agents.rs b/crates/wizard-gui/src/agents.rs index 1ad0a86..83fbed2 100644 --- a/crates/wizard-gui/src/agents.rs +++ b/crates/wizard-gui/src/agents.rs @@ -56,6 +56,21 @@ pub(crate) async fn get_agent_state(app: tauri::AppHandle) -> Result Result<(), String> { + let settings = settings::get_state(&app).map_err(|error| format!("{error:#}"))?; + tauri::async_runtime::spawn_blocking(move || { + wizard_core::agents::launch::launch(agent, &settings) + }) + .await + .context("Не удалось выполнить запуск агента") + .flatten() + .map_err(|error| format!("{error:#}")) +} + #[tauri::command] pub(crate) async fn get_agent_backups(agent: BackupAgent) -> Result, String> { // TODO: files can make this response large and include credentials. diff --git a/crates/wizard-gui/src/desktop_install.rs b/crates/wizard-gui/src/desktop_install.rs index a07a6a8..29bd5c7 100644 --- a/crates/wizard-gui/src/desktop_install.rs +++ b/crates/wizard-gui/src/desktop_install.rs @@ -205,8 +205,7 @@ pub(crate) fn start_background_checks(app: tauri::AppHandle) { None, Operation::Check, true, - false, - false, + InstallOptions::default(), ) .is_err() { @@ -243,8 +242,7 @@ pub(crate) fn check_desktop_release( Some(token), Operation::Check, false, - false, - false, + InstallOptions::default(), ) } @@ -260,8 +258,7 @@ pub(crate) fn download_desktop_release( Some(token), Operation::Download, false, - false, - false, + InstallOptions::default(), ) } @@ -310,13 +307,15 @@ pub(crate) async fn get_desktop_running_apps( } /// `confirmed` approves the change that the selected release asks to confirm. `close` approves -/// closing the applications that the user was told run now. +/// closing the applications that the user was told run now. Onboarding defers the first +/// launch until configuration; other callers retain the default immediate first launch. #[tauri::command] pub(crate) fn install_desktop_release( app: tauri::AppHandle, desktop: DesktopApp, confirmed: bool, close: bool, + open_after_install: Option, ) -> Result<(), String> { start( app, @@ -324,8 +323,11 @@ pub(crate) fn install_desktop_release( None, Operation::Install, false, - confirmed, - close, + InstallOptions { + confirmed, + close, + open_after_install: open_after_install.unwrap_or(true), + }, ) .inspect_err(|message| { log::error!( @@ -335,14 +337,20 @@ pub(crate) fn install_desktop_release( }) } +#[derive(Clone, Copy, Default)] +struct InstallOptions { + confirmed: bool, + close: bool, + open_after_install: bool, +} + fn start( app: tauri::AppHandle, desktop: DesktopApp, token: Option, operation: Operation, automatic: bool, - confirmed: bool, - close: bool, + install: InstallOptions, ) -> Result<(), String> { let manager = Arc::clone(app.state::().get(desktop)); if manager.unsupported { @@ -395,7 +403,9 @@ fn start( if !matches!(session.package, Some(Package::Downloaded(_))) { return Err(format!("Сначала скачайте {name}")); } - manager.signal.notify(State::Installing { close }); + manager.signal.notify(State::Installing { + close: install.close, + }); } } @@ -407,8 +417,7 @@ fn start( token, operation, automatic, - confirmed, - close, + install, pause, ) .await; @@ -533,8 +542,7 @@ async fn run( token: Option, operation: Operation, automatic: bool, - confirmed: bool, - close: bool, + install: InstallOptions, pause: Option>, ) -> Result<(), String> { let desktop = manager.desktop; @@ -657,7 +665,7 @@ async fn run( let version = download.release.display_version.clone(); let target = download.release.target.clone(); let result = tauri::async_runtime::spawn_blocking(move || { - installer::install_release(&download, confirmed, close) + installer::install_release(&download, install.confirmed, install.close) }) .await .map_err(|error| { @@ -709,18 +717,20 @@ async fn run( } // After the daemon restart, which could otherwise restart a daemon that the new // application has just started. - let notice = tauri::async_runtime::spawn_blocking(move || { - installer::open_first_install(&target) - }) - .await - .unwrap_or_else(|_| { - log::error!("{} first launch worker failed", desktop.product()); - Some(format!( - "Не удалось открыть {}. Откройте его вручную.", - desktop.product() - )) - }); - installed.notices.extend(notice); + if install.open_after_install { + let notice = tauri::async_runtime::spawn_blocking(move || { + installer::open_first_install(&target) + }) + .await + .unwrap_or_else(|_| { + log::error!("{} first launch worker failed", desktop.product()); + Some(format!( + "Не удалось открыть {}. Откройте его вручную.", + desktop.product() + )) + }); + installed.notices.extend(notice); + } manager.signal.notify(State::Installed { version, notices: installed.notices, diff --git a/crates/wizard-gui/src/lib.rs b/crates/wizard-gui/src/lib.rs index 554756f..defcd32 100644 --- a/crates/wizard-gui/src/lib.rs +++ b/crates/wizard-gui/src/lib.rs @@ -133,6 +133,7 @@ pub fn run_application() -> Result<()> { hub_tokens::refresh_hub_tokens, proxy::get_proxy_state, agents::get_agent_state, + agents::launch_agent, agents::get_agent_backups, agents::prepare_agent_change, agents::apply_agent_plan, diff --git a/crates/wizard-gui/tauri.conf.json b/crates/wizard-gui/tauri.conf.json index 58b4dbf..04b9662 100644 --- a/crates/wizard-gui/tauri.conf.json +++ b/crates/wizard-gui/tauri.conf.json @@ -34,6 +34,7 @@ "form-action": ["'none'"], "frame-ancestors": ["'none'"], "img-src": ["'self'", "data:"], + "media-src": ["'self'", "https://coreinfra.ru/assets/wizard/"], "object-src": ["'none'"], "script-src": ["'self'"], "style-src": ["'self'"] @@ -46,6 +47,7 @@ "form-action": ["'none'"], "frame-ancestors": ["'none'"], "img-src": ["'self'", "data:"], + "media-src": ["'self'", "https://coreinfra.ru/assets/wizard/"], "object-src": ["'none'"], "script-src": ["'self'"], "style-src": ["'self'", "'unsafe-inline'"] diff --git a/crates/wizard-gui/wizard-ui/src/App.tsx b/crates/wizard-gui/wizard-ui/src/App.tsx index e0a987f..5090e00 100644 --- a/crates/wizard-gui/wizard-ui/src/App.tsx +++ b/crates/wizard-gui/wizard-ui/src/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useSyncExternalStore } from "react"; +import { useCallback, useEffect, useState, useSyncExternalStore } from "react"; import { AppSidebar } from "./AppSidebar"; import { AgentPage } from "./agents/AgentPage"; import { useAgentState } from "./agents/agents_state"; @@ -14,12 +14,22 @@ import { HubSignIn } from "./settings/HubSignIn"; import { SettingsPage } from "./settings/SettingsPage"; import { useUpdateState } from "./updates/update"; import { UpdateScreen } from "./updates/UpdateScreen"; +import { Overview } from "./overview/Overview"; function subscribeNavigation(onChange: () => void) { window.addEventListener("hashchange", onChange); return () => window.removeEventListener("hashchange", onChange); } +const onboardingKey = "coreinfra.onboarding.completed"; + +function needsOnboarding() { + // A direct link to an agent or settings should still open that page normally. + if (pageFromHash(window.location.hash) !== "overview") return false; + try { return localStorage.getItem(onboardingKey) !== "true"; } + catch { return true; } +} + function App() { const update = useUpdateState(); const agents = useAgentState(); @@ -27,6 +37,11 @@ function App() { const account = useHubAccountControl(); const page = useSyncExternalStore(subscribeNavigation, () => pageFromHash(window.location.hash)); const state = update.state; + const [onboarding, setOnboarding] = useState(needsOnboarding); + const finishOnboarding = useCallback(() => { + try { localStorage.setItem(onboardingKey, "true"); } catch { /* The current session can still continue. */ } + setOnboarding(false); + }, []); // Pages share the window scroll; start each one from the top. useEffect(() => { @@ -46,14 +61,18 @@ function App() { return ( } > - - {page === "settings" && } - {page !== "settings" && agents.status === "loading" && Загрузка…} - {page !== "settings" && agents.status === "error" && Не удалось загрузить состояние агентов: {agents.message}} - {agents.status === "ready" && } + {page === "overview" ? : <> + + {page === "settings" && } + {page !== "settings" && agents.status === "loading" && Загрузка…} + {page !== "settings" && agents.status === "error" && Не удалось загрузить состояние агентов: {agents.message}} + {agents.status === "ready" && } + } ); } diff --git a/crates/wizard-gui/wizard-ui/src/AppSidebar.tsx b/crates/wizard-gui/wizard-ui/src/AppSidebar.tsx index df2667e..8acc0bb 100644 --- a/crates/wizard-gui/wizard-ui/src/AppSidebar.tsx +++ b/crates/wizard-gui/wizard-ui/src/AppSidebar.tsx @@ -1,6 +1,7 @@ import type { ComponentType, ComponentPropsWithoutRef } from "react"; import { useClose } from "@headlessui/react"; -import { agentPaths, type AgentPageId, type AppPageId } from "./agents/navigation"; +import { Squares2X2Icon } from "@heroicons/react/20/solid"; +import { agentPaths, overviewPath, type AgentPageId, type AppPageId } from "./agents/navigation"; import { AppLogo } from "./components/AppLogo"; import { ClaudeIcon, OpenAiIcon, OpenCodeIcon, PiIcon } from "./components/BrandIcons"; import { Button } from "./components/catalyst/button"; @@ -20,7 +21,7 @@ export function AppSidebar({ page, account, update }: { function item(id: AgentPageId, label: string, Icon: ComponentType>) { return ( - + {label} @@ -30,12 +31,18 @@ export function AppSidebar({ page, account, update }: { return ( - + + + + Обзор + + Агенты {item("claude_desktop", "Claude Desktop", ClaudeIcon)} diff --git a/crates/wizard-gui/wizard-ui/src/agents/AgentConfiguration.tsx b/crates/wizard-gui/wizard-ui/src/agents/AgentConfiguration.tsx new file mode 100644 index 0000000..73150b1 --- /dev/null +++ b/crates/wizard-gui/wizard-ui/src/agents/AgentConfiguration.tsx @@ -0,0 +1,138 @@ +import { type ReactNode, useEffect, useState } from "react"; +import { type AgentChange, type AgentId, type HubMode, type RoutingMode, type TokenChoice } from "./agents_state"; +import { type HubTokensState, refreshHubTokens } from "../settings/hub_tokens"; +import { reportError } from "../logs/log"; +import { Button } from "../components/catalyst/button"; +import { FieldGroup, Fieldset, Label, Legend } from "../components/catalyst/fieldset"; +import { Radio, RadioField, RadioGroup } from "../components/catalyst/radio"; +import { Text } from "../components/catalyst/text"; +import { ErrorText } from "../components/ErrorText"; +import { useSystemProxy } from "../settings/system_proxy"; +import { SystemProxyPrompt } from "../settings/SystemProxyPrompt"; + +type ModeOption = { mode: M; label: string }; + +export const currentModeLabels: Record = { + sub: "Подписка", + hub: "API-доступ", + disabled: "Без CoreInfra", +}; + +export function routingModes(subscription: "Claude" | "Codex"): ModeOption[] { + return [ + { mode: "hub", label: "CoreInfra AI Hub – API-доступ (оплата за использование)" }, + { mode: "sub", label: `CoreInfra AI Hub – своя подписка ${subscription}` }, + { mode: "disabled", label: "Без CoreInfra AI Hub" }, + ]; +} + +export const hubModes: ModeOption[] = [ + { mode: "hub", label: "CoreInfra AI Hub – API-доступ (оплата за использование)" }, + { mode: "disabled", label: "Без CoreInfra AI Hub" }, +]; + +// Hub access shared by all pages. Token values are secrets: never log them. +export type Hub = HubTokensState & { signedIn: boolean }; + +// Names of Hub tokens automatically created for agents. +// Keep in sync with `TokenAgent::token_name` in `crates/wizard-core/src/agents/mod.rs`. +const createdTokenNames: Record = { + codex: "agent-codex", + claude: "agent-claude-code", + claude_desktop: "agent-claude-desktop", + opencode: "agent-opencode", + pi: "agent-pi", +}; + +// Only reuse credentials listed in the selected Hub. Wait for its list before +// offering creation; the backend creates on an explicit configure/download action. +export function getAgentToken(agent: AgentId, agentToken: string | null, hub: Hub) { + const createdName = createdTokenNames[agent]; + const ready = hub.signedIn && hub.status === "ready"; + const existing = hub.tokens.find((token) => token.token === agentToken) + ?? hub.tokens.filter((token) => token.name === createdName).sort((a, b) => a.issued_at - b.issued_at)[0]; + let selected: TokenChoice | undefined; + if (ready) { + selected = existing ? { kind: "existing", token: existing.token } : { kind: "create" }; + } + return { selected, ready, name: existing ? existing.name || "без названия" : createdName }; +} + +export function TokenNote({ token, hub, disabled }: { + token: ReturnType; + hub: Hub; + disabled: boolean; +}) { + if (!hub.signedIn) return Войдите в CoreInfra Hub, чтобы Wizard создал токен для агента.; + if (hub.status === "error") return
+ {hub.error} + +
; + if (!token.ready) return Проверяем токен агента…; + return {token.selected?.kind === "create" ? "Будет создан и использован" : "Будет использован"} токен «{token.name}» для аутентификации в хабе.; +} + +// The same connection form is used by the agent page and initial setup. +export function RoutingFieldset({ agent, modes, mode, toChange, agentToken, token: tokenOverride, hub, note, disabled, error, onPrepare, initialMode, actions, actionsClassName = "" }: { + agent: AgentId; + token?: ReturnType; + modes: ModeOption[]; + mode: M; + toChange: (mode: M) => AgentChange; + agentToken: string | null; + hub: Hub; + note?: ReactNode; + disabled: boolean; + error?: string; + onPrepare: (change: AgentChange, token: TokenChoice | null) => void; + initialMode?: M; + actions?: ReactNode; + actionsClassName?: string; +}) { + const [draft, setDraft] = useState(initialMode); + const selected = draft ?? mode; + const enabled = selected !== "disabled"; + const proxyOnly = agent === "claude_desktop" && selected === "sub"; + const token = tokenOverride ?? getAgentToken(agent, agentToken, hub); + const systemProxy = useSystemProxy(); + const [proxyPrompt, setProxyPrompt] = useState(false); + + useEffect(() => { + if (draft === mode) setDraft(undefined); + }, [draft, mode]); + + function chooseMode(value: M) { + setDraft(value); + if (value === "sub" && systemProxy.state?.status !== "on") setProxyPrompt(true); + } + + return <> +
+ Подключение + {note && {note}} + + chooseMode(value as M)}> + {modes.map((option) => ( + + + + + ))} + + {proxyOnly ? Для аутентификации будет использован токен «coreinfra-ai-wizard» из личного хаба. Если его ещё нет, Wizard создаст его автоматически. + : (enabled || tokenOverride !== undefined) && } +
+ {actions} + +
+ {error && {error}} +
+
+ {proxyPrompt && setProxyPrompt(false)} />} + ; +} diff --git a/crates/wizard-gui/wizard-ui/src/agents/AgentPage.tsx b/crates/wizard-gui/wizard-ui/src/agents/AgentPage.tsx index f9b5f51..233f605 100644 --- a/crates/wizard-gui/wizard-ui/src/agents/AgentPage.tsx +++ b/crates/wizard-gui/wizard-ui/src/agents/AgentPage.tsx @@ -1,199 +1,20 @@ -import { Fragment, type ReactNode, useEffect, useState } from "react"; -import { type AgentChange, type AgentDetection, type AgentId, type AgentStates, type BackupAgent, type HubMode, type PreparedAgentChange, type RoutingMode, type TokenChoice, prepareAgentChange } from "./agents_state"; +import { Fragment, type ReactNode, useState } from "react"; +import { type AgentChange, type AgentDetection, type AgentId, type AgentStates, type BackupAgent, type PreparedAgentChange, type RoutingMode, type TokenChoice, prepareAgentChange } from "./agents_state"; +import { currentModeLabels, routingModes, hubModes, getAgentToken, TokenNote, RoutingFieldset, type Hub } from "./AgentConfiguration"; import { PreparedPlanDialog } from "./PreparedPlanDialog"; import { BackupDialog } from "./BackupDialog"; import { DesktopInstall, useDesktopInstall } from "./DesktopInstall"; -import { type HubTokensState, refreshHubTokens, tokenLabel, tokenPrefix, useHubTokens } from "../settings/hub_tokens"; +import { tokenLabel, useHubTokens } from "../settings/hub_tokens"; import type { HubAccountControl } from "../settings/HubAccount"; -import { hubDisplayName } from "../settings/hub_account"; import { useProxy } from "./proxy"; import { reportError } from "../logs/log"; import { Badge } from "../components/catalyst/badge"; import { Button } from "../components/catalyst/button"; import { DescriptionDetails, DescriptionList, DescriptionTerm } from "../components/catalyst/description-list"; -import { Description, ErrorMessage, Field, FieldGroup, Fieldset, Label, Legend } from "../components/catalyst/fieldset"; +import { FieldGroup, Fieldset, Legend } from "../components/catalyst/fieldset"; import { Heading } from "../components/catalyst/heading"; -import { Listbox, ListboxDescription, ListboxLabel, ListboxOption } from "../components/catalyst/listbox"; -import { Radio, RadioField, RadioGroup } from "../components/catalyst/radio"; -import { Text } from "../components/catalyst/text"; import { ErrorText } from "../components/ErrorText"; -type ModeOption = { mode: M; label: string }; - -const currentModeLabels: Record = { - sub: "Подписка", - hub: "API-доступ", - disabled: "Без CoreInfra", -}; - -function routingModes(subscription: "Claude" | "Codex"): ModeOption[] { - return [ - { mode: "disabled", label: "Без CoreInfra AI Hub" }, - { mode: "hub", label: "CoreInfra AI Hub – API-доступ (оплата за использование)" }, - { mode: "sub", label: `CoreInfra AI Hub – своя подписка ${subscription}` }, - ]; -} - -const hubModes: ModeOption[] = [ - { mode: "disabled", label: "Без CoreInfra AI Hub" }, - { mode: "hub", label: "CoreInfra AI Hub – API-доступ (оплата за использование)" }, -]; - -// Hub access shared by all pages. Token values are secrets: never log them. -type Hub = HubTokensState & { signedIn: boolean; tokenSource?: string }; - -// Names of Hub tokens created for agents, used for the default choice and the create option. -// Keep in sync with `TokenAgent::token_name` in `crates/wizard-core/src/agents/mod.rs`. -const createdTokenNames: Record = { - codex: "agent-codex", - claude: "agent-claude-code", - claude_desktop: "agent-claude-desktop", - opencode: "agent-opencode", - pi: "agent-pi", -}; - -// `token: null` is the option that creates the agent's Hub token. -type TokenOption = { key: string; label: string; current?: boolean; token: string | null }; - -// Everything the token menu shows. Choosing an option only changes the local draft: creating -// happens on an explicit apply/check/download action in the backend. -// Selected: the draft, else the agent's token, else the oldest Hub token with the created name, -// else creating. Creating is offered only when the loaded list has no such token: an unknown list -// must not suggest a duplicate. Once a created token is listed, it replaces a create draft -// (not the agent's other token), so a retry after a failed preparation does not create another. -function useTokenMenu(agent: AgentId, agentToken: string | null, hub: Hub) { - const [draft, setDraft] = useState(); - const createdName = createdTokenNames[agent]; - - const options: TokenOption[] = []; - // The agent's own token comes first, even when Hub does not list it (another hub, signed out). - if (agentToken !== null) { - options.push({ key: agentToken, label: tokenLabel(agentToken, hub.tokens), current: true, token: agentToken }); - } - // Other Hub tokens, without the current one and tokens Wizard created for other agents; - // this agent's created tokens come first. - const otherNames = Object.values(createdTokenNames).filter((name) => name !== createdName); - const visible = hub.tokens - .filter((token) => token.token !== agentToken && !otherNames.includes(token.name)) - .sort((a, b) => Number(b.name === createdName) - Number(a.name === createdName)); - for (const token of visible) { - options.push({ key: token.token, label: token.name || tokenPrefix(token.token), token: token.token }); - } - const listed = (token: string | null | undefined): token is string => - options.some((option) => option.token !== null && option.token === token); - - const named = hub.tokens - .filter((token) => token.name === createdName) - .sort((a, b) => a.issued_at - b.issued_at)[0]?.token; - const canCreate = hub.signedIn && hub.status === "ready" && named === undefined; - if (canCreate) { - options.splice(1, 0, { key: "create", label: `Создать ${createdName}`, token: null }); - } - - let selected: TokenChoice | undefined; - if (draft?.kind === "create") { - selected = named === undefined ? draft : { kind: "existing", token: named }; - } else { - const token = [draft?.token, agentToken, named].find(listed); - selected = token !== undefined ? { kind: "existing", token } : canCreate ? { kind: "create" } : undefined; - } - const ready = hub.signedIn && hub.status === "ready" && selected !== undefined - && (selected.kind === "create" ? canCreate : listed(selected.token)); - const selectedOption = options.find((option) => - selected?.kind === "create" ? option.token === null : option.token === selected?.token); - - // An applied change replaces the agent token; show it instead of the old draft. - useEffect(() => setDraft(undefined), [agentToken]); - - function choose(option: TokenOption) { - setDraft(option.token === null ? { kind: "create" } : { kind: "existing", token: option.token }); - } - - return { options, selected, selectedOption, choose, ready }; -} - -function TokenField({ token, hub, disabled }: { - token: ReturnType; - hub: Hub; - disabled: boolean; -}) { - return ( - - - - {token.options.map((option) => ( - - {option.label} - {option.current && Текущий} - - ))} - - {!hub.signedIn && Войдите в CoreInfra Hub для выбора токена.} - {hub.status === "error" && ( - - {hub.error}{" "} - - - )} - - ); -} - -// Mode and token of one agent. The saved mode wins until the user picks another one. -function RoutingFieldset({ agent, modes, mode, toChange, agentToken, token: tokenOverride, hub, note, disabled, error, onPrepare }: { - agent: AgentId; - token?: ReturnType; - modes: ModeOption[]; - mode: M; - toChange: (mode: M) => AgentChange; - agentToken: string | null; - hub: Hub; - note?: ReactNode; - disabled: boolean; - error?: string; - onPrepare: (change: AgentChange, token: TokenChoice | null) => void; -}) { - const [draft, setDraft] = useState(); - const selected = draft ?? mode; - const enabled = selected !== "disabled"; - const proxyOnly = agent === "claude_desktop" && selected === "sub"; - const localToken = useTokenMenu(agent, agentToken, hub); - const token = tokenOverride ?? localToken; - - useEffect(() => { - if (draft === mode) setDraft(undefined); - }, [draft, mode]); - - return ( -
- Подключение - {note && {note}} - - setDraft(value as M)}> - {modes.map((option) => ( - - - - - ))} - - {(enabled || tokenOverride !== undefined) && } -
- - {error &&
{error}
} -
-
-
- ); -} - function PageHeading({ title, actions }: { title: string; actions?: ReactNode }) { return (
@@ -266,16 +87,14 @@ export function AgentPage({ agents, page, proxy, account }: { const [error, setError] = useState<{ page: AgentId | null; message: string }>(); const pageError = error?.page === page ? error.message : undefined; const isChangeInProgress = isPreparingPlan || preparedChange !== undefined; - const activeHub = account.account?.profile?.hubs.find((item) => item.hub_id === account.account?.active_hub_id); const hub: Hub = { ...useHubTokens(account.account?.active_hub_id), signedIn: account.signedIn, - tokenSource: activeHub && (activeHub.is_personal ? "Токен из личного хаба" : `Токен из хаба ${hubDisplayName(activeHub)}`), }; - const claudeDesktopToken = useTokenMenu("claude_desktop", agents.claude_desktop.status === "found" ? agents.claude_desktop.data.token : null, hub); + const claudeDesktopToken = getAgentToken("claude_desktop", agents.claude_desktop.status === "found" ? agents.claude_desktop.data.token : null, hub); const claudeInstall = useDesktopInstall("claude"); // ChatGPT downloads use the token of the shared ChatGPT / Codex routing. - const codexToken = useTokenMenu("codex", agents.codex.status === "found" ? agents.codex.data.token : null, hub); + const codexToken = getAgentToken("codex", agents.codex.status === "found" ? agents.codex.data.token : null, hub); const chatGptInstall = useDesktopInstall("chatgpt"); async function prepare(change: AgentChange, token: TokenChoice | null) { @@ -320,7 +139,7 @@ export function AgentPage({ agents, page, proxy, account }: { Прокси для ChatGPT - {chatGptProxyStopped && Прокси для ChatGPT не запущен, нажмите «Применить».} + {chatGptProxyStopped && Прокси для ChatGPT не запущен, нажмите «Завершить настройку».} {codex.status === "found" && ( @@ -336,7 +155,7 @@ export function AgentPage({ agents, page, proxy, account }: {
{chatGptFound ? "Обновление ChatGPT" : "Установка ChatGPT"} - {codex.status !== "found" && } + {codex.status !== "found" && } @@ -386,13 +205,12 @@ export function AgentPage({ agents, page, proxy, account }: { {desktop.status === "found" && ( ({ ClaudeDesktopSetRouting: mode })} agentToken={desktop.data.token} hub={hub} - note="Для входа в аккаунт включите VPN и примените режим «Без CoreInfra AI Hub» в Wizard." disabled={isChangeInProgress} error={pageError} onPrepare={prepare} /> )}
{desktop.status === "found" ? "Обновление приложения" : "Установка приложения"} - {desktop.status !== "found" && } + {desktop.status !== "found" && } diff --git a/crates/wizard-gui/wizard-ui/src/agents/PreparedPlanDialog.tsx b/crates/wizard-gui/wizard-ui/src/agents/PreparedPlanDialog.tsx index a756cb9..fa3abc1 100644 --- a/crates/wizard-gui/wizard-ui/src/agents/PreparedPlanDialog.tsx +++ b/crates/wizard-gui/wizard-ui/src/agents/PreparedPlanDialog.tsx @@ -7,17 +7,18 @@ import { Dialog, DialogActions, DialogBody, DialogDescription, DialogTitle } fro import { Text } from "../components/catalyst/text"; const agentNames: Record = { - codex: "Codex", + codex: "ChatGPT / Codex", claude: "Claude Code", pi: "Pi", opencode: "OpenCode", claude_desktop: "Claude Desktop", }; -export function PreparedPlanDialog({ prepared, onReprepared, onClose }: { +export function PreparedPlanDialog({ prepared, onReprepared, onClose, onApplied }: { prepared: PreparedAgentChange; onReprepared: (prepared: PreparedAgentChange) => void; onClose: () => void; + onApplied?: () => void; }) { const { agent, info } = prepared; const hasChanges = info.length > 0; @@ -53,6 +54,7 @@ export function PreparedPlanDialog({ prepared, onReprepared, onClose }: { try { await applyAgentPlan(prepared.plan); + onApplied?.(); onClose(); } catch (cause: unknown) { const message = "Не удалось применить изменения"; @@ -86,14 +88,14 @@ export function PreparedPlanDialog({ prepared, onReprepared, onClose }: { {error &&
{error}
} - {error && } {hasChanges && } diff --git a/crates/wizard-gui/wizard-ui/src/agents/navigation.ts b/crates/wizard-gui/wizard-ui/src/agents/navigation.ts index 9e43e67..282d0e2 100644 --- a/crates/wizard-gui/wizard-ui/src/agents/navigation.ts +++ b/crates/wizard-gui/wizard-ui/src/agents/navigation.ts @@ -1,7 +1,8 @@ import type { AgentId } from "./agents_state"; export type AgentPageId = AgentId; -export type AppPageId = AgentPageId | "settings"; +export type AppPageId = AgentPageId | "overview" | "settings"; +export const overviewPath = "/overview"; export const settingsPath = "/settings"; export const agentPaths: Record = { @@ -16,5 +17,5 @@ export function pageFromHash(hash: string): AppPageId { const path = hash.replace(/^#/, "").replace(/\/+$/, ""); if (path === settingsPath) return "settings"; return (Object.keys(agentPaths) as AgentPageId[]) - .find((page) => agentPaths[page] === path) ?? "claude_desktop"; + .find((page) => agentPaths[page] === path) ?? "overview"; } diff --git a/crates/wizard-gui/wizard-ui/src/assets/logo-wizard.svg b/crates/wizard-gui/wizard-ui/src/assets/logo-wizard.svg index 8be4084..b39973d 100644 --- a/crates/wizard-gui/wizard-ui/src/assets/logo-wizard.svg +++ b/crates/wizard-gui/wizard-ui/src/assets/logo-wizard.svg @@ -3,7 +3,7 @@