feat(aiturk): hide what the paired IDE cannot serve, plain error sentences, reconnect on return

When paired with AITURK IDE:
- an "unknown method" (-32601) answer and the proxy's 403/route-404 are shown
  as plain sentences, never as raw JsonRpcError text; a method the IDE does
  not have is not sent again on the same socket
- Account connectors, Vault, Keys and Files are hidden (the IDE has no
  connectors.* / vault.* and its phone proxy refuses /api/env and /api/files)
- an idle-closed chat socket is reopened when the app returns to the
  foreground; idle tunnel connections are dropped on a network change
- an unsaved chat no longer polls /api/sessions/<id>
- the pairing screen shows the app version

A plain Hermes connection is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ppceaR5s6cvMnm7uGRnf
This commit is contained in:
yilsemandClaude Opus 5.5 committed 2026-10-05 17:21:32 +03:00
1 parent c2d828b90a
commit 827c74b3c3
18 files changed
+709 -22

No files matched your search

@@ -52,7 +52,9 @@ import com.m57.hermescontrol.data.local.AuthManager
import com.m57.hermescontrol.data.ws.ConnectionStatus
import com.m57.hermescontrol.data.ws.HermesWsClient
import com.m57.hermescontrol.theme.LocalHermesStatusColors
import com.m57.hermescontrol.ui.aiturkpair.AiturkFeatureGate
import com.m57.hermescontrol.ui.aiturkpair.AiturkPairDeepLinkEffect
import com.m57.hermescontrol.ui.aiturkpair.AiturkUnavailableScreen
import com.m57.hermescontrol.ui.common.DisableDrawerGestures
import com.m57.hermescontrol.ui.common.DrawerGestureController
import com.m57.hermescontrol.ui.common.LocalDrawerGestureController
@@ -115,7 +117,11 @@ private fun appEntryProvider(
ScreenRegistry.ALL_SCREENS.forEach { screen ->
addEntryProvider(clazz = screen.key::class) {
screen.content(sessionId, openDrawer)
if (AiturkFeatureGate.shows(screen.key)) {
screen.content(sessionId, openDrawer)
} else {
AiturkUnavailableScreen(titleRes = screen.labelRes, onOpenDrawer = openDrawer)
}
}
}
@@ -325,6 +331,7 @@ fun MainNavigation(sessionId: String? = null) {
)
ScreenRegistry.ALL_SCREENS
.filter { it.drawerSection == section }
.filter { AiturkFeatureGate.shows(it.key) }
.forEach { entry ->
NavigationDrawerItem(
icon = { Icon(entry.icon, contentDescription = null) },