add devtools-protocol

This commit is contained in:
2026-03-24 13:40:17 +00:00
parent 93c13f93aa
commit 6695b3bc5f
7 changed files with 151 additions and 0 deletions
@@ -115,6 +115,7 @@ impl PrometeuRunner {
// Enviar Handshake
let handshake = DebugResponse::Handshake {
protocol_version: DEVTOOLS_PROTOCOL_VERSION,
runtime_version: "0.1".to_string(),
cartridge: HandshakeCartridge {
app_id: self.firmware.os.current_app_id,
@@ -693,6 +694,7 @@ mod tests {
let n = stream.read(&mut buf).expect("Deve ler handshake");
let resp: serde_json::Value = serde_json::from_slice(&buf[..n]).expect("Handshake deve ser JSON válido");
assert_eq!(resp["type"], "handshake");
assert_eq!(resp["protocol_version"], DEVTOOLS_PROTOCOL_VERSION);
// Envia start via JSON
stream.write_all(b"{\"type\":\"start\"}\n").expect("Conexão deve estar aberta para escrita");