From 0a4ef6a47ed12a3ef2f5c439a2fb5f60f7bce078 Mon Sep 17 00:00:00 2001 From: "James (ClawdBot)" Date: Sun, 8 Feb 2026 01:30:06 -0500 Subject: [PATCH] chore: auto-commit uncommitted changes --- .../com/inou/clawdnode/calls/CallScreener.kt | 9 +++--- .../inou/clawdnode/calls/VoiceCallService.kt | 31 +++++++++---------- .../notifications/NotificationListener.kt | 6 ++-- .../com/inou/clawdnode/security/TokenStore.kt | 6 ++-- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/com/inou/clawdnode/calls/CallScreener.kt b/app/src/main/java/com/inou/clawdnode/calls/CallScreener.kt index f25778d..c29498f 100644 --- a/app/src/main/java/com/inou/clawdnode/calls/CallScreener.kt +++ b/app/src/main/java/com/inou/clawdnode/calls/CallScreener.kt @@ -8,10 +8,9 @@ import android.os.IBinder import android.telecom.Call import android.telecom.CallScreeningService import android.util.Log +import com.inou.clawdnode.gateway.DirectGateway import com.inou.clawdnode.ClawdNodeApp import com.inou.clawdnode.debug.DebugClient -import com.inou.clawdnode.gateway.DirectGateway -import com.inou.clawdnode.protocol.CallIncomingEvent import com.inou.clawdnode.service.NodeService /** @@ -73,12 +72,12 @@ class CallScreener : CallScreeningService() { // Send event to Gateway via WebSocket try { - val event = CallIncomingEvent( + DirectGateway.sendCall( callId = callId, number = number, - contact = contactName + contact = contactName, + state = "incoming" ) - nodeService?.sendEvent(event) DebugClient.log("Call event sent to gateway", mapOf("callId" to callId)) } catch (e: Exception) { DebugClient.error("Failed to send call event", e) diff --git a/app/src/main/java/com/inou/clawdnode/calls/VoiceCallService.kt b/app/src/main/java/com/inou/clawdnode/calls/VoiceCallService.kt index b23427b..273ae7d 100644 --- a/app/src/main/java/com/inou/clawdnode/calls/VoiceCallService.kt +++ b/app/src/main/java/com/inou/clawdnode/calls/VoiceCallService.kt @@ -13,6 +13,7 @@ import android.speech.SpeechRecognizer import android.speech.tts.TextToSpeech import android.speech.tts.UtteranceProgressListener import android.telecom.Call +import com.inou.clawdnode.gateway.DirectGateway import android.telecom.InCallService import android.telecom.VideoProfile import android.util.Log @@ -141,12 +142,12 @@ class VoiceCallService : InCallService(), TextToSpeech.OnInitListener { Call.STATE_DISCONNECTED -> { // Call ended val duration = 0 // TODO: Calculate actual duration - val event = CallEndedEvent( + DirectGateway.sendCall( callId = callId, - durationSeconds = duration, - outcome = "completed" + number = call.details.handle?.schemeSpecificPart, + contact = null, + state = "ended" ) - nodeService?.sendEvent(event) ClawdNodeApp.instance.auditLog.logCall( "CALL_ENDED", @@ -308,12 +309,11 @@ class VoiceCallService : InCallService(), TextToSpeech.OnInitListener { Log.i(tag, "STT result: $transcript") currentCallId?.let { callId -> - val event = CallAudioEvent( - callId = callId, - transcript = transcript, - isFinal = true - ) - nodeService?.sendEvent(event) + DirectGateway.sendLog("call.audio", mapOf( + "callId" to callId, + "transcript" to transcript, + "isFinal" to true + )) } // Continue listening @@ -329,12 +329,11 @@ class VoiceCallService : InCallService(), TextToSpeech.OnInitListener { Log.d(tag, "STT partial: $transcript") currentCallId?.let { callId -> - val event = CallAudioEvent( - callId = callId, - transcript = transcript, - isFinal = false - ) - nodeService?.sendEvent(event) + DirectGateway.sendLog("call.audio.partial", mapOf( + "callId" to callId, + "transcript" to transcript, + "isFinal" to false + )) } } diff --git a/app/src/main/java/com/inou/clawdnode/notifications/NotificationListener.kt b/app/src/main/java/com/inou/clawdnode/notifications/NotificationListener.kt index 22a8543..6401d90 100644 --- a/app/src/main/java/com/inou/clawdnode/notifications/NotificationListener.kt +++ b/app/src/main/java/com/inou/clawdnode/notifications/NotificationListener.kt @@ -171,16 +171,14 @@ class NotificationListener : NotificationListenerService() { // Send via WebSocket if connected try { - val event = NotificationEvent( + DirectGateway.sendNotification( id = notificationId, app = appName, packageName = sbn.packageName, title = title, text = text, - actions = actions, - timestamp = sbn.postTime + actions = actions ) - nodeService?.sendEvent(event) } catch (e: Exception) { DebugClient.error("WebSocket send failed", e) } diff --git a/app/src/main/java/com/inou/clawdnode/security/TokenStore.kt b/app/src/main/java/com/inou/clawdnode/security/TokenStore.kt index 87ff495..6b54d19 100644 --- a/app/src/main/java/com/inou/clawdnode/security/TokenStore.kt +++ b/app/src/main/java/com/inou/clawdnode/security/TokenStore.kt @@ -50,8 +50,8 @@ class TokenStore(context: Context) { private const val KEY_GATEWAY_TOKEN = "gateway_token" private const val KEY_NODE_ID = "node_id" - // Default values - ClawdNode custom gateway (not Clawdbot) - private const val DEFAULT_GATEWAY_URL = "ws://100.123.216.65:9878" - private const val DEFAULT_GATEWAY_TOKEN = "" // No token needed for custom gateway + // Default values - OpenClaw gateway + private const val DEFAULT_GATEWAY_URL = "https://james.jongsma.me" + private const val DEFAULT_GATEWAY_TOKEN = "2dee57cc3ce2947c27ce9e848d5c3e95cc452f25a1477462" } }