create-ekka-desktop-app 0.3.2 → 0.3.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ekka-desktop-app",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Create an EKKA desktop app with built-in demo backend. No setup required.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -741,18 +741,9 @@ fn handle_ensure_node_identity(state: &EngineState) -> EngineResponse {
741
741
  /// Requires local engine to be available (strict local engine mode).
742
742
  /// Does NOT use Ed25519 register/challenge/session flow.
743
743
  fn handle_bootstrap_node_session(payload: &Value, state: &EngineState) -> EngineResponse {
744
- // STRICT LOCAL ENGINE MODE: Gate node_auth + node_runner behind engine availability
745
- if !state.is_engine_available() {
746
- tracing::warn!(
747
- op = "node_runner.skipped.engine_unavailable",
748
- engine_available = false,
749
- "Node session bootstrap skipped: local engine not available"
750
- );
751
- return EngineResponse::err(
752
- "ENGINE_UNAVAILABLE",
753
- "Local engine not available. Node session requires local engine.",
754
- );
755
- }
744
+ // NodeSessionRunner is an in-process runner that uses node session auth (Authorization: Bearer).
745
+ // It does NOT require the local engine-bootstrap binary - it makes direct HTTP calls to the engine API.
746
+ // The engine_available check was overly restrictive and has been removed.
756
747
 
757
748
  // Get home_path
758
749
  let home_path = match state.home_path.lock() {
@@ -51,25 +51,42 @@ fn build_engine_env() -> Result<Vec<(&'static str, String)>, &'static str> {
51
51
  env.push(("EKKA_ENGINE_URL", url.to_string()));
52
52
  }
53
53
 
54
- // EKKA_INTERNAL_SERVICE_KEY - required for engine mode
54
+ // EKKA_INTERNAL_SERVICE_KEY - optional for desktop (only needed for engine-bootstrap binary)
55
+ // Desktop runner uses node session auth, not internal key
55
56
  let internal_key = std::env::var("EKKA_INTERNAL_SERVICE_KEY")
56
57
  .or_else(|_| std::env::var("INTERNAL_SERVICE_KEY"))
57
- .map_err(|_| "EKKA_INTERNAL_SERVICE_KEY")?;
58
- env.push(("EKKA_INTERNAL_SERVICE_KEY", internal_key));
59
-
60
- // EKKA_TENANT_ID - required, must be valid UUID
61
- let tenant_id = std::env::var("EKKA_TENANT_ID")
62
- .map_err(|_| "EKKA_TENANT_ID")?;
63
- uuid::Uuid::parse_str(&tenant_id)
64
- .map_err(|_| "EKKA_TENANT_ID")?;
65
- env.push(("EKKA_TENANT_ID", tenant_id));
66
-
67
- // EKKA_WORKSPACE_ID - required, must be valid UUID
68
- let workspace_id = std::env::var("EKKA_WORKSPACE_ID")
69
- .map_err(|_| "EKKA_WORKSPACE_ID")?;
70
- uuid::Uuid::parse_str(&workspace_id)
71
- .map_err(|_| "EKKA_WORKSPACE_ID")?;
72
- env.push(("EKKA_WORKSPACE_ID", workspace_id));
58
+ .ok();
59
+
60
+ if let Some(ref key) = internal_key {
61
+ env.push(("EKKA_INTERNAL_SERVICE_KEY", key.clone()));
62
+ tracing::info!(
63
+ op = "desktop.internal_key.optional",
64
+ present = true,
65
+ "Internal service key configured (for engine-bootstrap)"
66
+ );
67
+ } else {
68
+ tracing::info!(
69
+ op = "desktop.internal_key.optional",
70
+ present = false,
71
+ "Internal service key not set (desktop runner uses node session auth)"
72
+ );
73
+ }
74
+
75
+ // EKKA_TENANT_ID - optional for desktop (only needed for engine-bootstrap binary)
76
+ // Desktop runner gets tenant_id from node session
77
+ if let Ok(tenant_id) = std::env::var("EKKA_TENANT_ID") {
78
+ if uuid::Uuid::parse_str(&tenant_id).is_ok() {
79
+ env.push(("EKKA_TENANT_ID", tenant_id));
80
+ }
81
+ }
82
+
83
+ // EKKA_WORKSPACE_ID - optional for desktop (only needed for engine-bootstrap binary)
84
+ // Desktop runner gets workspace_id from node session
85
+ if let Ok(workspace_id) = std::env::var("EKKA_WORKSPACE_ID") {
86
+ if uuid::Uuid::parse_str(&workspace_id).is_ok() {
87
+ env.push(("EKKA_WORKSPACE_ID", workspace_id));
88
+ }
89
+ }
73
90
 
74
91
  // Node credentials: Try keychain first, fall back to env vars
75
92
  // This enables headless engine startup without manual env exports
@@ -8,6 +8,7 @@ use serde::Deserialize;
8
8
 
9
9
  /// Response from /.well-known/ekka-configuration
10
10
  #[derive(Debug, Deserialize)]
11
+ #[allow(dead_code)] // Fields used for deserialization, may not all be read
11
12
  pub struct WellKnownConfig {
12
13
  pub grant_verify_key_b64: String,
13
14
  pub grant_signing_algorithm: String,