create-ekka-desktop-app 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -88,7 +88,7 @@ pub fn engine_request(req: EngineRequest, state: State<EngineState>, app_handle:
|
|
|
88
88
|
"auth.set" => auth::handle_set(&req.payload, &state),
|
|
89
89
|
|
|
90
90
|
// Node Credentials (routed to Desktop Core process via JSON-RPC)
|
|
91
|
-
// After successful set,
|
|
91
|
+
// After successful set, TS calls engine_connect and proceeds to login
|
|
92
92
|
"nodeCredentials.set" => handle_node_credentials_set_via_core(&req.payload, &state, app_handle),
|
|
93
93
|
"nodeCredentials.status" => state.core_process.request("nodeCredentials.status", &req.payload),
|
|
94
94
|
"nodeCredentials.clear" => state.core_process.request("nodeCredentials.clear", &req.payload),
|
|
@@ -307,11 +307,11 @@ fn handle_setup_status(state: &EngineState) -> EngineResponse {
|
|
|
307
307
|
// Node Credentials Handlers
|
|
308
308
|
// =============================================================================
|
|
309
309
|
|
|
310
|
-
/// Set node credentials via Desktop Core process
|
|
310
|
+
/// Set node credentials via Desktop Core process
|
|
311
311
|
///
|
|
312
312
|
/// Core handles validation and encrypted storage.
|
|
313
|
-
///
|
|
314
|
-
fn handle_node_credentials_set_via_core(payload: &Value, state: &EngineState,
|
|
313
|
+
/// TS handles the post-onboarding transition: handleSetupComplete() → ekka.connect() → login.
|
|
314
|
+
fn handle_node_credentials_set_via_core(payload: &Value, state: &EngineState, _app_handle: AppHandle) -> EngineResponse {
|
|
315
315
|
tracing::info!(op = "rust.local.op", opName = "nodeCredentials.set", "Routing nodeCredentials.set to Desktop Core");
|
|
316
316
|
|
|
317
317
|
let resp = state.core_process.request("nodeCredentials.set", payload);
|
|
@@ -319,11 +319,8 @@ fn handle_node_credentials_set_via_core(payload: &Value, state: &EngineState, ap
|
|
|
319
319
|
if resp.ok {
|
|
320
320
|
tracing::info!(
|
|
321
321
|
op = "desktop.onboarding.complete",
|
|
322
|
-
"Credentials stored via Core -
|
|
322
|
+
"Credentials stored via Core - TS will call engine_connect and proceed"
|
|
323
323
|
);
|
|
324
|
-
// Restart app to run full startup with credentials
|
|
325
|
-
// This triggers: updater check → node auth → engine spawn
|
|
326
|
-
app_handle.restart();
|
|
327
324
|
}
|
|
328
325
|
|
|
329
326
|
resp
|
|
@@ -303,33 +303,48 @@ fn find_core_binary() -> Result<std::path::PathBuf, String> {
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
// 3.
|
|
306
|
+
// 3. Workspace target directory (dev builds)
|
|
307
307
|
let manifest_dir = env!("CARGO_MANIFEST_DIR");
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
.
|
|
314
|
-
|
|
315
|
-
|
|
308
|
+
for profile in &["debug", "release"] {
|
|
309
|
+
let candidate = std::path::PathBuf::from(manifest_dir)
|
|
310
|
+
.join("target")
|
|
311
|
+
.join(profile)
|
|
312
|
+
.join("ekka-desktop-core");
|
|
313
|
+
if candidate.exists() {
|
|
314
|
+
return Ok(candidate);
|
|
315
|
+
}
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
//
|
|
319
|
-
|
|
320
|
-
.
|
|
321
|
-
|
|
318
|
+
// 4. Dev convenience: auto-build on first run
|
|
319
|
+
tracing::info!(
|
|
320
|
+
op = "core.binary.auto_build",
|
|
321
|
+
"Desktop Core binary not found — building automatically..."
|
|
322
|
+
);
|
|
323
|
+
let status = Command::new("cargo")
|
|
324
|
+
.args(["build", "-p", "ekka-desktop-core"])
|
|
325
|
+
.current_dir(manifest_dir)
|
|
326
|
+
.status()
|
|
327
|
+
.map_err(|e| format!("Failed to run cargo build: {}", e))?;
|
|
328
|
+
|
|
329
|
+
if !status.success() {
|
|
330
|
+
return Err(format!(
|
|
331
|
+
"Failed to auto-build Desktop Core (exit {:?}). Build manually:\n \
|
|
332
|
+
cd {} && cargo build -p ekka-desktop-core",
|
|
333
|
+
status.code(),
|
|
334
|
+
manifest_dir
|
|
335
|
+
));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
let built = std::path::PathBuf::from(manifest_dir)
|
|
322
339
|
.join("target")
|
|
323
|
-
.join("
|
|
340
|
+
.join("debug")
|
|
324
341
|
.join("ekka-desktop-core");
|
|
325
|
-
if
|
|
326
|
-
return Ok(
|
|
342
|
+
if built.exists() {
|
|
343
|
+
return Ok(built);
|
|
327
344
|
}
|
|
328
345
|
|
|
329
346
|
Err(format!(
|
|
330
|
-
"Desktop Core binary not found.
|
|
331
|
-
|
|
332
|
-
Or set EKKA_DESKTOP_CORE_BIN env var.",
|
|
333
|
-
manifest_dir
|
|
347
|
+
"Desktop Core binary not found after build. Expected at: {}",
|
|
348
|
+
built.display()
|
|
334
349
|
))
|
|
335
350
|
}
|