Marketplace: Tauri commands, store-owned fields and startup refresh
The 21 marketplace commands, registered and granted; marketplace fields kept store-owned in update_settings/update_project; a background refresh of every marketplace at app start. - apply_marketplace_now emits marketplace-sync-finished per project (F4). - Settings export carries marketplace account tokens in ExportedSecrets (account id -> token) and import restores them; imported accounts, marketplaces and global installs are validated with the commands' own rules before anything is written. The import preview discloses the marketplace count, token count and global hook installs, and warns on the latter (F10). - refresh_pins and cache removal hold the repo lock (F11). - ops::validate_host/validate_branch delegate to auth::valid_host and git::valid_branch (F13). - A finished gh container login frees only its own cancel slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -232,7 +232,6 @@ pub fn run() {
|
||||
.unwrap_or_else(|| std::env::temp_dir().join("triple-c")),
|
||||
));
|
||||
let marketplace_setup = marketplace.clone();
|
||||
let _ = &marketplace_setup;
|
||||
|
||||
// Clone Arcs for the setup closure (web terminal auto-start)
|
||||
let projects_store_setup = projects_store.clone();
|
||||
@@ -308,6 +307,21 @@ pub fn run() {
|
||||
.await;
|
||||
});
|
||||
|
||||
// Marketplaces: refresh each once at startup, in the background.
|
||||
// Failures are logged, not toasted — the Marketplace tab shows them.
|
||||
{
|
||||
let settings = settings_store_setup.get();
|
||||
let marketplace = marketplace_setup.clone();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
for m in &settings.marketplaces {
|
||||
let snap = crate::marketplace::refresh_marketplace(&marketplace, &settings, &m.id).await;
|
||||
if let Some(e) = snap.fetch_error {
|
||||
log::warn!("Marketplace \"{}\" could not be refreshed at startup: {}", m.name, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Auto-start web terminal server if enabled in settings
|
||||
let settings = settings_store_setup.get();
|
||||
if settings.web_terminal.enabled {
|
||||
@@ -529,6 +543,28 @@ pub fn run() {
|
||||
commands::auth_token_commands::has_claude_token,
|
||||
commands::auth_token_commands::clear_claude_token,
|
||||
commands::auth_token_commands::sweep_claude_token_snapshots,
|
||||
// Marketplace
|
||||
commands::marketplace_commands::list_marketplace_snapshots,
|
||||
commands::marketplace_commands::refresh_marketplaces,
|
||||
commands::marketplace_commands::add_marketplace,
|
||||
commands::marketplace_commands::update_marketplace,
|
||||
commands::marketplace_commands::remove_marketplace,
|
||||
commands::marketplace_commands::install_marketplace_item,
|
||||
commands::marketplace_commands::uninstall_marketplace_item,
|
||||
commands::marketplace_commands::set_global_item_disabled,
|
||||
commands::marketplace_commands::forget_marketplace_installs,
|
||||
commands::marketplace_commands::list_marketplace_updates,
|
||||
commands::marketplace_commands::marketplace_item_diff,
|
||||
commands::marketplace_commands::update_marketplace_item,
|
||||
commands::marketplace_commands::apply_marketplace_now,
|
||||
commands::marketplace_commands::get_marketplace_sync_report,
|
||||
commands::marketplace_commands::add_marketplace_token_account,
|
||||
commands::marketplace_commands::add_marketplace_gh_host_account,
|
||||
commands::marketplace_commands::start_marketplace_gh_container_login,
|
||||
commands::marketplace_commands::cancel_marketplace_gh_login,
|
||||
commands::marketplace_commands::test_marketplace_account,
|
||||
commands::marketplace_commands::remove_marketplace_account,
|
||||
commands::marketplace_commands::marketplace_gh_host_available,
|
||||
// Settings
|
||||
commands::settings_commands::get_settings,
|
||||
commands::settings_commands::update_settings,
|
||||
|
||||
Reference in New Issue
Block a user