commit f817aafd3d65a735800393c3ac1d5a7486a6d94e
parent 802e7b1636fd17aa28a3ce3a83e1d17a070ca182
Author: triesap <tyson@radroots.org>
Date: Sat, 23 May 2026 10:09:48 +0000
runtime: expose path-scoped desktop bootstrap
- add a desktop runtime constructor for explicit path sets
- export the runtime handle for integration harnesses
- hide private remote signer errors from the public command error
- leave unrelated working-tree changes unstaged
Diffstat:
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/crates/launchers/desktop/src/lib.rs b/crates/launchers/desktop/src/lib.rs
@@ -12,6 +12,7 @@ mod source_guards;
mod window;
pub use app::AppLaunchError;
+pub use runtime::DesktopAppRuntime;
pub fn run() -> Result<(), AppLaunchError> {
app::launch()
diff --git a/crates/launchers/desktop/src/runtime.rs b/crates/launchers/desktop/src/runtime.rs
@@ -123,6 +123,23 @@ impl DesktopAppRuntime {
Self::from_state(state)
}
+ pub fn bootstrap_with_paths(
+ paths: AppDesktopRuntimePaths,
+ default_nostr_relay_url: String,
+ ) -> Self {
+ let runtime_snapshot = default_runtime_snapshot();
+ let state = match DesktopAppRuntimeState::bootstrap_from_paths(
+ paths,
+ default_nostr_relay_url,
+ runtime_snapshot.clone(),
+ ) {
+ Ok(state) => state,
+ Err(error) => DesktopAppRuntimeState::degraded_with_snapshot(error, runtime_snapshot),
+ };
+
+ Self::from_state(state)
+ }
+
pub fn summary(&self) -> DesktopAppRuntimeSummary {
let state = self.lock_state();
let sync_status = DesktopAppSyncStatusSummary {
@@ -3813,8 +3830,8 @@ pub enum DesktopAppRuntimeCommandError {
Accounts(#[from] DesktopAccountsCommandError),
#[error(transparent)]
Projection(#[from] DesktopAccountsProjectionError),
- #[error(transparent)]
- RemoteSigner(#[from] DesktopRemoteSignerError),
+ #[error("remote signer command failed: {0}")]
+ RemoteSigner(String),
#[error(transparent)]
Sqlite(#[from] AppSqliteError),
#[error(transparent)]
@@ -3827,6 +3844,12 @@ pub enum DesktopAppRuntimeCommandError {
PackDayBatchPrint(#[from] PackDayBatchPrintError),
}
+impl From<DesktopRemoteSignerError> for DesktopAppRuntimeCommandError {
+ fn from(error: DesktopRemoteSignerError) -> Self {
+ Self::RemoteSigner(error.to_string())
+ }
+}
+
#[derive(Debug, Error)]
pub enum DesktopAppRuntimeFarmSetupError {
#[error("desktop runtime commands are unavailable while the runtime is degraded")]