From 6bc802fe2df85222f8be90e14e4089713e9911b1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 23:04:27 +0100 Subject: [PATCH] Separate Muninn provider and Eve surface records --- crates/muninn-daemon/src/main.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/muninn-daemon/src/main.rs b/crates/muninn-daemon/src/main.rs index 2aa583a..bede5f2 100644 --- a/crates/muninn-daemon/src/main.rs +++ b/crates/muninn-daemon/src/main.rs @@ -520,6 +520,10 @@ fn move_hue_program_key(host_id: &str) -> String { format!("muninn:{host_id}:move-hue-program") } +fn move_hue_surface_key(host_id: &str) -> String { + format!("surface:muninn.telemetry.{host_id}.move-hue") +} + fn load_or_initialize_move_hue_program( options: &Options, ) -> Result>> { @@ -2967,6 +2971,7 @@ fn publish_move_hue_eve_surface( .get::(&program_key)? .unwrap_or_else(|| bootstrap_move_hue_program(options)); let provider_id = muninn_provider_id(options); + let surface_key = move_hue_surface_key(&options.host_id); let action = |id: &str, label: &str, mode: Option<&str>, order_mode: Option<&str>, cycle_ms: Option| { json!({ "id": format!("{provider_id}.move-hue.{id}"), @@ -3053,7 +3058,7 @@ fn publish_move_hue_eve_surface( } }), }; - node.put(&provider_id, &surface)?; + node.put(&surface_key, &surface)?; if let Some(target) = resolve_odin_cultmesh_uri(options) { let _ = node.publish_document_to_rudp_catalog( &program_key, @@ -3069,7 +3074,7 @@ fn publish_move_hue_eve_surface( }, ); let _ = node.publish_document_to_rudp_catalog( - &provider_id, + &surface_key, &surface, CultMeshRudpDocumentPublishOptions { target, @@ -3395,6 +3400,12 @@ fn publish_runtime_boundary_records( "endpoints": provider_endpoints, "inputStreams": provider_input_streams, "routes": provider_routes, + "surfaces": [{ + "surfaceId": format!("{provider_id}.move-hue.surface"), + "surfaceKind": "gamecult.eve.surface_state.v1", + "recordRef": move_hue_surface_key(&options.host_id), + "title": "Move Hue Program" + }], "commandSurface": { "commandBoundaryId": command_boundary_key, "transportProfileId": transport_profile_key @@ -11431,7 +11442,7 @@ mod tests { let mut node = open_node(&options, "muninn-move-hue-eve-test").unwrap(); publish_surface(&mut node, &options, "idle", &[]).unwrap(); let surface = node - .get_required::("muninn.telemetry.nightwing") + .get_required::(&move_hue_surface_key("nightwing")) .unwrap(); let encoded = surface.surface.to_string(); assert!(encoded.contains("Hold Current Colors"));