Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.
feat: add about_samosa_ai tool and an About Us settings page
Durganshu Mishraa428d712abd4
diff --git a/app/src/main/assets/company/about-samosa-ai.md b/app/src/main/assets/company/about-samosa-ai.mdnew file mode 100644index 0000000..3483196--- /dev/null+++ b/app/src/main/assets/company/about-samosa-ai.md@@ -0,0 +1,83 @@+# About Samosa AI++Samosa AI — "A taste of innovation."++Samosa AI builds privacy-first, open, and delightful AI tools for learning and productivity. Gotcha, the app you are using right now, is one of them.++Website: https://samosa-ai.com++## Mission++To build personalized, AI-driven tools that make learning, working, and creating more effective and enjoyable.++## Core values++Privacy First — your data stays yours, and processing happens locally wherever it can.++Open Innovation — the work is built in public, and much of it is open source.++User Empowerment — you stay in control of what the software does on your behalf.++Accessibility — tools should be usable by everyone, not just specialists.++## Products++### Gotcha++A fully on-device Android assistant with 80+ tools, Monitor and Operator modes, and the Assistive Ball for hands-free control from any app. Runs privacy-first with local execution.++https://samosa-ai.com/gotcha — documentation at https://samosa-ai.com/gotcha/docs++### Chanakya++An open-source, self-hostable voice assistant that runs local AI/ML models and connects to 1000+ third-party MCP servers, including Home Assistant.++https://samosa-ai.com/chanakya++### Personal Guru++A personalized learning companion with Chat, Chapters, Flashcards, Quizzes, and Reels modes.++https://samosa-ai.com/personal-guru++### Voice Typing++A Linux desktop dictation service with global hotkeys, wake word, LLM post-processing, and a web UI.++https://samosa-ai.com/voice-typing++### OpenCode Go Multi-Auth++A multi-account proxy router for OpenCode Go API subscriptions.++https://samosa-ai.com/opencode-go-multi-auth++### Server Services Manager++A self-hosted Linux process manager and server control panel.++https://samosa-ai.com/server-services-manager++### Mobile OpenCode Control++A mobile-first web controller for local OpenCode coding sessions.++https://samosa-ai.com/mobile-opencode-control++## Coming soon++AI-PCP, ConsensusAI, Listener, and Watcher are announced but not yet released.++## Gotcha's terms and policies++Gotcha ships three legal documents in the app: Terms and Conditions, a Disclaimer and Declaration, and a Data Retention and Privacy Policy. In short: the assistant is powered by a generative AI model, so its output can be wrong and should be verified before you act on it — especially for actions with real-world consequences. You are responsible for the instructions you give the agent and the actions it takes on your behalf, and the app must only be used lawfully. Gotcha is privacy-first and runs on-device wherever it can.++These summaries are not the agreements themselves. The full, authoritative text is bundled in the app under Settings > About Us > Legal. Read it there before relying on any summary.++## Pricing++The pricing page at https://samosa-ai.com/pricing currently says pricing information is coming soon. Check that page for the current answer rather than relying on this document.++## Developers and contact++Samosa AI is open source and built in public. The code lives on GitHub at https://github.com/Rishabh-Bajpai, there is a blog at https://blog.samosa-ai.com, and the team can be reached at [email protected].diff --git a/app/src/main/java/com/gotcha/tools/CompanyInfoTool.kt b/app/src/main/java/com/gotcha/tools/CompanyInfoTool.ktnew file mode 100644index 0000000..91c8ad4--- /dev/null+++ b/app/src/main/java/com/gotcha/tools/CompanyInfoTool.kt@@ -0,0 +1,26 @@+package com.gotcha.tools++import android.content.Context++/**+ * Answers questions about Samosa AI — the company behind Gotcha, its other+ * products, pricing, and how to reach the developers.+ *+ * The content is bundled as an asset rather than fetched, so the agent can+ * answer offline and the answer never drifts with the network. The same+ * document backs the Settings > About Us page, which reads it directly.+ */+class CompanyInfoTool(private val context: Context) {++ fun aboutSamosaAi(): ToolResult = try {+ val text = context.assets.open(ABOUT_ASSET)+ .use { it.readBytes().toString(Charsets.UTF_8) }+ ToolResult.ok(text)+ } catch (e: Exception) {+ ToolResult.error("Could not read Samosa AI info: ${e.message}")+ }++ companion object {+ const val ABOUT_ASSET = "company/about-samosa-ai.md"+ }+}diff --git a/app/src/main/java/com/gotcha/tools/ToolDefinitions.kt b/app/src/main/java/com/gotcha/tools/ToolDefinitions.ktindex 912a7b9..6787712 100644--- a/app/src/main/java/com/gotcha/tools/ToolDefinitions.kt+++ b/app/src/main/java/com/gotcha/tools/ToolDefinitions.kt@@ -43,6 +43,17 @@ object ToolDefinitions {})+ val aboutSamosaAi = tool(+ "about_samosa_ai",+ "Get information about Samosa AI, the company that makes Gotcha: its mission and " ++ "values, its other products (Chanakya, Personal Guru, Voice Typing and more), " ++ "pricing, the developers and how to contact them, and a summary of Gotcha's terms, " ++ "disclaimer and data-retention policy. Call this for ANY question about Samosa AI, " ++ "its products, its terms or privacy policy, who built this app, or how to reach " ++ "them — do not guess at these from memory.",+ schema { putJsonObject("properties") {} }+ )+val getStorageInfo = tool("get_storage_info","Report total, used and free internal storage of the device.",@@ -2184,6 +2195,7 @@ object ToolDefinitions {)val all: List<ToolDefinition> = listOf(+ aboutSamosaAi,dialNumber, getStorageInfo, getBatteryInfo, listFiles, readFile, writeFile,openApp, setBrightness, toggleWifi, openSetting,setWallpaper, runCommand,diff --git a/app/src/main/java/com/gotcha/tools/ToolExecutor.kt b/app/src/main/java/com/gotcha/tools/ToolExecutor.ktindex ee60984..f2fd4f2 100644--- a/app/src/main/java/com/gotcha/tools/ToolExecutor.kt+++ b/app/src/main/java/com/gotcha/tools/ToolExecutor.kt@@ -47,6 +47,7 @@ class ToolExecutor(private val appsTool = AppsTool(appContext)private val clipboardTool = ClipboardTool(appContext)private val mediaCaptureTool = MediaCaptureTool(appContext)+ private val companyInfoTool = CompanyInfoTool(appContext)// Tier 3 toolsprivate val webSearchTool = WebSearchTool()@@ -166,6 +167,7 @@ class ToolExecutor("dial_number" -> phoneTool.dialNumber(args.requireString("number") ?: return missing("number"))"get_storage_info" -> storageTool.getStorageInfo()"get_battery_info" -> systemTool.getBatteryInfo()+ "about_samosa_ai" -> companyInfoTool.aboutSamosaAi()"edit" -> editTool.edit(path = args.requireString("path") ?: return missing("path"),oldString = args.requireString("oldString") ?: return missing("oldString"),diff --git a/app/src/main/java/com/gotcha/tools/ToolRegistry.kt b/app/src/main/java/com/gotcha/tools/ToolRegistry.ktindex 62dc0f5..5abddc2 100644--- a/app/src/main/java/com/gotcha/tools/ToolRegistry.kt+++ b/app/src/main/java/com/gotcha/tools/ToolRegistry.kt@@ -51,7 +51,8 @@ object ToolRegistry {"read_screen", "read_notifications","check_root", "search_skills","get_health_summary", "get_health_records",- "get_now_playing"+ "get_now_playing",+ "about_samosa_ai")val monitorTools: Set<String> = baseMonitorTools + ConnectorCatalog.monitorToolsdiff --git a/app/src/main/java/com/gotcha/ui/AboutScreen.kt b/app/src/main/java/com/gotcha/ui/AboutScreen.ktnew file mode 100644index 0000000..e49bac5--- /dev/null+++ b/app/src/main/java/com/gotcha/ui/AboutScreen.kt@@ -0,0 +1,105 @@+package com.gotcha.ui++import android.content.Context+import androidx.compose.foundation.clickable+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.padding+import androidx.compose.material3.HorizontalDivider+import androidx.compose.material3.MaterialTheme+import androidx.compose.material3.Text+import androidx.compose.runtime.Composable+import androidx.compose.runtime.LaunchedEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue+import androidx.compose.ui.Modifier+import androidx.compose.ui.platform.LocalUriHandler+import androidx.compose.ui.platform.testTag+import androidx.compose.ui.text.style.TextDecoration+import androidx.compose.ui.unit.dp+import com.gotcha.tools.CompanyInfoTool++/**+ * The About Us page: who Samosa AI is, what else they make, how to reach them,+ * and the way through to the Legal documents.+ *+ * The body is the same bundled asset the `about_samosa_ai` tool reads+ * ([CompanyInfoTool.ABOUT_ASSET]), so what the agent says about the company and+ * what this page shows cannot drift apart. It is rendered with the same small+ * Markdown pass the Legal page uses.+ */+@Composable+fun AboutScreen(+ context: Context,+ onBack: () -> Unit,+ onOpenPage: (SettingsPage) -> Unit+) {+ val overlay = rememberSettingsOverlayState()+ val uriHandler = LocalUriHandler.current++ var aboutText by remember { mutableStateOf<String?>(null) }++ LaunchedEffect(Unit) {+ aboutText = readAsset(context, CompanyInfoTool.ABOUT_ASSET)+ }++ SettingsScaffold(title = SettingsPage.ABOUT.title, onBack = onBack, overlay = overlay) {+ Text(+ text = renderLegalMarkdown(aboutText ?: "(loading…)"),+ style = MaterialTheme.typography.bodyMedium+ )++ HorizontalDivider(thickness = 1.dp)++ Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {+ Text(+ text = "Open in your browser",+ style = MaterialTheme.typography.titleMedium+ )+ LINKS.forEach { (label, url) ->+ LinkRow(label = label, url = url, onOpen = uriHandler::openUri)+ }+ }++ HorizontalDivider(thickness = 1.dp)++ SettingsNavRow(+ page = SettingsPage.LEGAL,+ onClick = { onOpenPage(SettingsPage.LEGAL) },+ modifier = Modifier.testTag(SettingsPage.LEGAL.testTag)+ )+ }+}++@Composable+private fun LinkRow(label: String, url: String, onOpen: (String) -> Unit) {+ Text(+ text = label,+ style = MaterialTheme.typography.bodyMedium,+ color = MaterialTheme.colorScheme.primary,+ textDecoration = TextDecoration.Underline,+ modifier = Modifier+ .fillMaxWidth()+ .clickable { onOpen(url) }+ .padding(vertical = 8.dp)+ )+}++/**+ * Kept here rather than parsed out of the asset: the asset is prose the agent+ * reads, and pulling tappable rows out of it would mean the page silently loses+ * links whenever the copy is reworded.+ */+private val LINKS = listOf(+ "Samosa AI website" to "https://samosa-ai.com",+ "About us" to "https://samosa-ai.com/about-us",+ "Gotcha" to "https://samosa-ai.com/gotcha",+ "Gotcha documentation" to "https://samosa-ai.com/gotcha/docs",+ "Pricing" to "https://samosa-ai.com/pricing",+ "Blog" to "https://blog.samosa-ai.com",+ "GitHub" to "https://github.com/Rishabh-Bajpai",+ "Email [email protected]" to "mailto:[email protected]"+)diff --git a/app/src/main/java/com/gotcha/ui/LegalScreen.kt b/app/src/main/java/com/gotcha/ui/LegalScreen.ktindex 3766525..6ba21cb 100644--- a/app/src/main/java/com/gotcha/ui/LegalScreen.kt+++ b/app/src/main/java/com/gotcha/ui/LegalScreen.kt@@ -137,7 +137,8 @@ private fun ColumnScope.AcceptBlock()}-private fun readAsset(context: Context, path: String): String = try {+/** Shared with [AboutScreen], which renders the bundled company copy the same way. */+internal fun readAsset(context: Context, path: String): String = try {context.assets.open(path).use { it.readBytes().toString(Charsets.UTF_8) }} catch (t: Throwable) {"Failed to read asset $path: ${t.message ?: t::class.java.simpleName}"diff --git a/app/src/main/java/com/gotcha/ui/SettingsCommon.kt b/app/src/main/java/com/gotcha/ui/SettingsCommon.ktindex 3c4f3f6..2654794 100644--- a/app/src/main/java/com/gotcha/ui/SettingsCommon.kt+++ b/app/src/main/java/com/gotcha/ui/SettingsCommon.kt@@ -61,7 +61,12 @@ import kotlinx.coroutines.delay* Declaration order is the order of the home list; nothing reads the ordinal, so* this is the only place the menu is arranged. What the assistant *is* comes* first — who it thinks you are, which model it runs, what it may touch — and- * the two pages about how the app presents itself sit at the end.+ * the page about how the app presents itself sits at the end.+ *+ * [LEGAL] is the one entry the home list does not show: it is reached from+ * inside [ABOUT], which is where a user looking for who made this app and what+ * they agreed to actually goes. It stays a full page here because it is still+ * routed to and deep-linked like any other. See `SettingsHome`.*/enum class SettingsPage(val title: String, val summary: String, val testTag: String) {PERSONAL_INFO(@@ -109,6 +114,11 @@ enum class SettingsPage(val title: String, val summary: String, val testTag: Str"How you're alerted when a reply arrives","settings_notifications_row"),+ ABOUT(+ "About Us",+ "Samosa AI, other products, legal, contact",+ "settings_about_row"+ ),LEGAL("Legal","Terms, disclaimer, data retention",diff --git a/app/src/main/java/com/gotcha/ui/SettingsScreen.kt b/app/src/main/java/com/gotcha/ui/SettingsScreen.ktindex bf1390a..697fe0f 100644--- a/app/src/main/java/com/gotcha/ui/SettingsScreen.kt+++ b/app/src/main/java/com/gotcha/ui/SettingsScreen.kt@@ -162,6 +162,11 @@ fun SettingsScreen(onBack = backToHome,onSyncServerMessages = onSyncServerMessages)+ SettingsPage.ABOUT -> AboutScreen(+ context = androidx.compose.ui.platform.LocalContext.current,+ onBack = backToHome,+ onOpenPage = onPageChange+ )SettingsPage.LEGAL -> LegalScreen(context = androidx.compose.ui.platform.LocalContext.current,load = load,@@ -189,6 +194,10 @@ private fun SettingsHome(SettingsScaffold(title = "Settings", onBack = onBack, overlay = overlay) {SettingsPage.entries.forEach { entry ->+ // Legal is reached from inside About Us rather than from here, so the+ // top level keeps one row for "who made this and what did I agree to".+ if (entry == SettingsPage.LEGAL) return@forEach+HorizontalDivider(thickness = 1.dp)SettingsNavRow(page = entry,@@ -197,7 +206,7 @@ private fun SettingsHome(.testTag(entry.testTag).then(entry.tourAnchorModifier()))- // Re-entry into the guided setup sits just above Legal, so the menu+ // Re-entry into the guided setup sits just above About Us, so the menu// ends on the two rows a returning user is least likely to need.if (entry == SettingsPage.NOTIFICATIONS) {HorizontalDivider(thickness = 1.dp)diff --git a/app/src/test/java/com/gotcha/tools/CompanyInfoToolTest.kt b/app/src/test/java/com/gotcha/tools/CompanyInfoToolTest.ktnew file mode 100644index 0000000..e92fce1--- /dev/null+++ b/app/src/test/java/com/gotcha/tools/CompanyInfoToolTest.kt@@ -0,0 +1,64 @@+package com.gotcha.tools++import android.content.Context+import androidx.test.core.app.ApplicationProvider+import org.junit.Assert.assertFalse+import org.junit.Assert.assertTrue+import org.junit.Test+import org.junit.runner.RunWith+import org.robolectric.RobolectricTestRunner+import org.robolectric.annotation.Config++/**+ * `about_samosa_ai`.+ *+ * The value of this tool is entirely in the bundled asset actually shipping and+ * actually containing the facts the agent is told it can answer from — a missing+ * or gutted asset would otherwise only surface as the agent confidently making+ * things up at runtime.+ */+@RunWith(RobolectricTestRunner::class)+@Config(sdk = [30, 34])+class CompanyInfoToolTest {++ private val context: Context = ApplicationProvider.getApplicationContext()+ private val tool = CompanyInfoTool(context)++ @Test+ fun `about_samosa_ai reads the bundled asset`() {+ val result = tool.aboutSamosaAi()++ assertTrue(result.message, result.success)+ assertTrue("expected substantial content, got ${result.message.length} chars", result.message.length > 500)+ }++ @Test+ fun `the bundled asset answers the questions the tool description promises`() {+ val text = tool.aboutSamosaAi().message++ listOf(+ "Samosa AI",+ "Chanakya",+ "Personal Guru",+ "Voice Typing",+ "samosa-ai.com",+ "[email protected]",+ "github.com/Rishabh-Bajpai"+ ).forEach {+ assertTrue("bundled about copy no longer mentions '$it'", text.contains(it))+ }+ }++ /**+ * The summary in the asset must send the user to the real documents rather+ * than standing in for them — the agent paraphrasing terms it invented is+ * exactly the failure the Disclaimer warns about.+ */+ @Test+ fun `the legal summary points at the in-app documents`() {+ val text = tool.aboutSamosaAi().message++ assertTrue(text.contains("Legal"))+ assertFalse("the summary must not claim to be the agreement itself", text.contains("BY INSTALLING"))+ }+}diff --git a/app/src/test/resources/feature-test-coverage.json b/app/src/test/resources/feature-test-coverage.jsonindex 014a5c8..f2c994b 100644--- a/app/src/test/resources/feature-test-coverage.json+++ b/app/src/test/resources/feature-test-coverage.json@@ -6,6 +6,14 @@"reason": "Needs an Android Context and a system service with real device state; no JVM-tier coverage yet — scheduled for the Robolectric tier.","manualSteps": "Ask the agent to 'open the dialer with +49123456789'; confirm the dialer opens pre-filled and does NOT place the call."},+ {+ "tool": "about_samosa_ai",+ "tier": "ROBOLECTRIC",+ "tests": [+ "com.gotcha.tools.CompanyInfoToolTest"+ ],+ "notes": "the bundled asset ships and still contains the company, product and contact facts the tool promises"+ },{"tool": "get_storage_info","tier": "ROBOLECTRIC",diff --git a/docs/FEATURE_TEST_COVERAGE.md b/docs/FEATURE_TEST_COVERAGE.mdindex a3a3274..9f5ec0f 100644--- a/docs/FEATURE_TEST_COVERAGE.md+++ b/docs/FEATURE_TEST_COVERAGE.md@@ -14,12 +14,12 @@ Every tool the assistant can call is listed below, together with how it is verif| Tier | Tools | What it means ||---|---:|---|| `UNIT` | 20 | Plain JVM unit test — no Android framework needed. |-| `ROBOLECTRIC` | 17 | JVM test against Robolectric's Android framework, often across several API levels. |+| `ROBOLECTRIC` | 18 | JVM test against Robolectric's Android framework, often across several API levels. || `INSTRUMENTED` | 0 | Runs on a real device or emulator (`app/src/androidTest`). || `MANUAL_ONLY` | 64 | No automated test — verified by hand, see the checklist below. |-| **Total** | **101** | |+| **Total** | **102** | |-**37 of 101** tools are covered by an automated test; the remaining 64 are manual-QA-only with a recorded reason.+**38 of 102** tools are covered by an automated test; the remaining 64 are manual-QA-only with a recorded reason.## Foreground tools (act on the screen)@@ -98,6 +98,7 @@ Every tool the assistant can call is listed below, together with how it is verif| Tool | Tier | Tests / reason ||---|---|---|+| `about_samosa_ai` | `ROBOLECTRIC` | `CompanyInfoToolTest` — the bundled asset ships and still contains the company, product and contact facts the tool promises || `ask_final_answer` | `MANUAL_ONLY` | Only reachable from inside a sub-agent loop with a live LLM connection. || `check_availability` | `UNIT` | `CalendarWindowTest` — free/busy window arithmetic || `check_root` | `MANUAL_ONLY` | Probes for a real `su` binary; the result is meaningless on a non-rooted test device. |