feat(app): Tauri window and the Windows build
M5 step 5, first part. app/shell is a Tauri 2 crate (jarvis.exe): one
window over app/ui whose invoke("admin") goes to AdminApi::call. Its
WebView2 data sits next to the location file; closing the window stops
the services and waits for a cancelled start (AdminApi::shutdown).
app/shell/package.sh cross-builds it on Linux (x86_64-pc-windows-gnu)
and lays out Jarvis/ with WebView2Loader.dll and python-src/
(voice_worker, jarvis). The worker's default sources are python-src next
to the executable when present, else the repository's src/.
The bot screen now shows the masked token right after saving.
Checked on the win-ci VM: the window and wizard, PC check, uv and worker
venv installed, a cancel leaving no uv/Python process, the token stored
DPAPI-encrypted, a start failing with its reason, logs, error copy, zip
export, closing the window ending the process, nothing under %APPDATA% or
%LOCALAPPDATA%; the core's unit tests on Windows (156/157, the one
Linux-path assumption fixed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -364,6 +364,7 @@ mod tests {
|
||||
assert!(Path::new(v["db_path"].as_str().unwrap()).starts_with(&l.data));
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
/// Default settings on a port nothing listens on (8080 may be taken on a developer's PC).
|
||||
fn unused_port_settings() -> Settings {
|
||||
let port = std::net::TcpListener::bind("127.0.0.1:0").unwrap().local_addr().unwrap().port();
|
||||
@@ -375,6 +376,7 @@ mod tests {
|
||||
serve(id, delay, None, Arc::new(Mutex::new("list"))).await
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
/// The same; once the file `gone` exists (a fake Strata's `--stop` makes it) it stops listening,
|
||||
/// so a connection is refused.
|
||||
async fn models_server_until(id: &'static str, delay: Duration, gone: Option<std::path::PathBuf>) -> u16 {
|
||||
@@ -606,12 +608,15 @@ mod tests {
|
||||
c.stop().await.unwrap();
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
/// The services as the controller sees them, reduced to the LLM.
|
||||
struct LlmHost {
|
||||
llm: Arc<Llm>,
|
||||
settings: Settings,
|
||||
}
|
||||
#[cfg(unix)]
|
||||
struct LlmRunning(Arc<Llm>);
|
||||
#[cfg(unix)]
|
||||
#[async_trait::async_trait]
|
||||
impl crate::control::Running for LlmRunning {
|
||||
async fn stop(&self) -> Result<(), String> {
|
||||
@@ -621,6 +626,7 @@ mod tests {
|
||||
json!({"worker": null, "voiceMembers": [], "missed": []})
|
||||
}
|
||||
}
|
||||
#[cfg(unix)]
|
||||
#[async_trait::async_trait]
|
||||
impl crate::control::Host for LlmHost {
|
||||
async fn start(&self) -> Result<(Arc<dyn crate::control::Running>, tokio::sync::mpsc::UnboundedReceiver<crate::discord::CoreEvent>), String> {
|
||||
|
||||
Reference in New Issue
Block a user