Mountain/RPC/CocoonService/Debug/StopDebugging.rs
1//! Stop an active debug session. Emits `sky://debug/sessionEnd` (NOT
2//! `/stop` - Sky listens on the former at `SkyBridge.ts:2234`;
3//! `DebugProvider.rs:351` emits the same channel from the lifecycle path).
4
5use serde_json::json;
6use tauri::Emitter;
7use tonic::{Response, Status};
8use ::Vine::Generated::{Empty, StopDebuggingRequest};
9
10use crate::{RPC::CocoonService::CocoonServiceImpl, dev_log};
11
12pub async fn Fn(Service:&CocoonServiceImpl, Request:StopDebuggingRequest) -> Result<Response<Empty>, Status> {
13 dev_log!("cocoon", "[CocoonService] stop_debugging: session={}", Request.session_id);
14
15 let _ = Service
16 .environment
17 .ApplicationHandle
18 .emit("sky://debug/sessionEnd", json!({ "sessionId": Request.session_id }));
19
20 Ok(Response::new(Empty {}))
21}