33 Commits

Author SHA1 Message Date
JordanTheJet
40e019eff3 Revise README with enhanced details and formatting
Updated README to simply introduction and give thanks to the fam
2026-02-25 18:15:43 -05:00
jordanthejet
a3a8016601 Add long-press stop button, wake word detection, and updated models
- Long-press overlay bubble to reveal red stop button that kills the agent
- Wake word detection with TensorFlow Lite for hands-free activation
- Updated README model table to reflect current provider models
- Various tool and UI improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:53:39 -05:00
jordanthejet
276134c9da Fix OpenAI/OpenRouter tool serialization and update all provider models
OpenAI & OpenRouter:
- Fix tool call serialization: assistant messages now include tool_calls
  array, tool results sent as role:"tool" with tool_call_id
- Sanitize dotted tool names (sms.read -> sms_read) for OpenAI compliance,
  reverse-map on response parsing

Model updates:
- Anthropic: claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5
- OpenAI: gpt-5.2 (default), gpt-5.2-chat-latest, gpt-5-mini
- Gemini: add gemini-3.1-pro-preview, drop deprecated gemini-2.0-flash
- OpenRouter: add anthropic/claude-sonnet-4.6, openai/gpt-5.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:58:14 -05:00
jordanthejet
f0bdc0dea4 Add CellClaw logo to README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:41:05 -05:00
jordanthejet
2a2551e582 Add README with setup guide, capabilities, and architecture overview
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:36:05 -05:00
jordanthejet
2bd2394d04 Merge branch 'feature/heartbeat' 2026-02-25 16:00:05 -05:00
jordanthejet
1358437359 Add heartbeat system for long-running task persistence
Agent loop previously exited to IDLE when the LLM returned no tool calls,
causing tasks like chess or dating apps to silently stop. This adds a
heartbeat system that periodically wakes the agent to check screen state
and act if needed.

- HeartbeatManager: Handler-based scheduler with exponential backoff
  (5s → 10s → 30s → 60s), renewable wake lock (5 min), active task context
- HeartbeatDetector: Classifies agent responses (HEARTBEAT_OK, acted, error)
- HeartbeatPrompt: Builds [Heartbeat Check] prompts with task context
- heartbeat.context tool: Agent sets/clears monitoring context
- AgentLoop.submitHeartbeat(): Non-cancelling heartbeat entry point with
  invisible event suppression and conversation history pruning
- CellClawService: Heartbeat lifecycle, notification shows monitoring state
- Identity: System prompt sections for screen reading strategy and heartbeat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:00:02 -05:00
jordanthejet
52c8b8b5d8 Merge branch 'feature/overlay-visibility' 2026-02-25 15:04:55 -05:00
jordanthejet
7e8ecc5ca6 Enhance overlay: visibility control, color states, double-tap, backdrop dismiss
- Add OverlayVisibilityController to temporarily hide overlay during
  screenshots and tap/swipe actions so it doesn't interfere
- Change bubble colors: green (idle), blue (thinking), orange (executing)
- Add double-tap bubble to open CellClaw app
- Add status label and response card for agent events
- Add fullscreen transparent backdrop to dismiss quick ask panel
  by tapping outside
- Remove Explain Screen button from panel
- Add drag callback to keep status positioned near bubble

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 15:04:34 -05:00
jordanthejet
19ff60ecd0 Add permission profile presets (Full Auto, Balanced, Cautious) to setup and settings
Users now choose an autonomy level during onboarding (new step 3 of 4) and can
switch profiles anytime in Settings. Individual tool toggles still work for
fine-tuning after selecting a profile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:38:27 -05:00
jordanthejet
664933a191 Fallback to next model on rate limit (429) and fix gradlew quoting
GeminiProvider now tries fallback models when hitting 429 rate limits,
not just 404. Removed permanent model lock-in so the primary model is
always retried first. Fixed gradlew DEFAULT_JVM_OPTS quoting that
caused "Could not find or load main class" error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:11:32 -05:00
JordanTheJet
ba5edd55d2 Save all work-in-progress changes before directory cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:23:41 -05:00
JordanTheJet
81a84380b1 Merge branch 'feature/floating-overlay'
# Conflicts:
#	app/src/main/AndroidManifest.xml
2026-02-20 23:14:17 -05:00
JordanTheJet
4aa99fd32f Merge branch 'feature/quick-settings-tile' 2026-02-20 23:12:30 -05:00
JordanTheJet
7c9456821d Merge branch 'feature/notification-actions' into feature/floating-overlay 2026-02-20 20:03:05 -05:00
JordanTheJet
8532b7f10a Fix overlay Quick Ask, accessibility detection, and add agent diagnostics
- Add Send button to overlay panel Quick Ask (was IME-action-only)
- Fix accessibility service detection using AccessibilityManager API
  instead of cross-process @Volatile var that never updates
- Add diagnostic logging to GeminiProvider.parseResponse and AgentLoop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:03:01 -05:00
JordanTheJet
f74ebcfd83 Fix notification to respect Android 3-action button limit
Prioritize Approve/Deny buttons when approvals are pending,
otherwise show Stop/Pause/Explain Screen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:48:34 -05:00
JordanTheJet
529504e89b Add Quick Settings tile for one-tap screenshot & explain
- New CellClawTileService with @EntryPoint for Hilt, tile state reflecting
  AgentState (ACTIVE/INACTIVE labels), and onClick screenshot+explain flow
  posting result to CHANNEL_ALERTS notification (ID 200)
- New ic_qs_cellclaw.xml 24dp monochrome vector for QS tile icon
- Register CellClawTileService in manifest with BIND_QUICK_SETTINGS_TILE
  permission, QS_TILE intent-filter, and ACTIVE_TILE metadata

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:41:36 -05:00
JordanTheJet
37edd55d87 Add floating overlay with draggable bubble and quick-action panel
- New OverlayService with TYPE_APPLICATION_OVERLAY bubble (48dp, state-tinted)
  and expandable panel with Explain Screen, Quick Ask, Approve/Deny actions
- BubbleTouchListener with drag vs tap detection (10dp threshold)
- Add overlayEnabled pref to AppConfig, state + setter to SettingsViewModel
- Add Overlay toggle section in SettingsScreen with SYSTEM_ALERT_WINDOW
  permission check and launch intent
- Start OverlayService from MainActivity when enabled + permitted
- Register SYSTEM_ALERT_WINDOW permission and OverlayService in manifest

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:40:17 -05:00
JordanTheJet
1fefde2cd7 Add notification actions: reply, explain screen, approve/deny
- New NotificationActionReceiver with 4 actions (reply via RemoteInput,
  screenshot+explain, approve all, deny all) using @EntryPoint for Hilt
- Rewrite CellClawService notification with live state observation via
  combine(agentLoop.state, approvalQueue.requests), dynamic Pause/Resume
  toggle, and conditional approve/deny buttons when approvals pending
- Register NotificationActionReceiver in AndroidManifest.xml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:37:50 -05:00
JordanTheJet
c0a4adc22b Add screenshot+vision, notification monitoring, scheduler, messaging automation, and voice I/O
Five new feature areas:
- Screenshot capture via a11y service + vision analysis tool with ContentBlock.Image support across all providers (Anthropic, OpenAI, Gemini)
- Notification listener service with query/filter and auto-trigger agent on app notifications
- Cron scheduler using WorkManager with periodic and one-shot scheduled tasks (Room DB v2)
- Messaging automation tools for opening, reading, and replying in WhatsApp/Telegram/Instagram
- Voice input (SpeechRecognizer STT) and output (TextToSpeech TTS) with settings toggles

Includes 8 new instrumented tests and smart_reply skill asset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:23:38 -05:00
JordanTheJet
afc7ed26b7 Add agent loop test for email send via Gemini
agentSendsEmail test sets up the full CellClaw agent loop with
EmailSendTool + UiAutomation tools and lets Gemini autonomously
compose the email, read the screen, and tap Send in Gmail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:00:41 -05:00
JordanTheJet
483caeeba5 Target Gmail explicitly in EmailSendTool and add instrumented tests
Set intent package to com.google.android.gm to bypass app chooser,
update tool description to guide agent to tap Send via screen.read +
app.automate, and add 4 mock validation tests plus a real end-to-end
Gmail send test with Samsung chooser fallback handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:59:16 -05:00
JordanTheJet
276dbcf78f Upgrade app automation for dating app control (swipe, read screen, etc.)
- Add AccessibilityBridge for bidirectional tool<->service communication
- Upgrade CellClawAccessibility: swipe gestures (left/right/up/down),
  screen reading with element bounds, find_element, wait_and_read
- AppAutomateTool now awaits results instead of fire-and-forget
- Add ScreenReadTool (screen.read) - read-only AUTO policy for
  reading foreground app UI elements and text
- Swipe gestures calibrated for card-swiping apps (60% screen width)
- All 3 E2E agent loop tests pass on Samsung Galaxy Z Flip

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 01:22:15 -05:00
JordanTheJet
b472e003f7 Add end-to-end agent loop tests that execute real tools on device
- browserSearchE2E: Gemini -> browser.search -> opens Chrome with Google search
- emailSendE2E: Gemini -> email.send -> opens email client with composed message
- clipboardWriteE2E: Gemini -> clipboard.write -> copies text to clipboard
- Full agent loop: user message -> AI thinking -> tool call -> tool execution -> response
- All 3 tests pass on Samsung Galaxy Z Flip (real device)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:26:47 -05:00
JordanTheJet
a5c3b37de6 Add browser search integration test for Gemini tool calling
- Test verifies Gemini calls browser.search with correct query params
- Query correctly contains boston and date keywords
- All 4 Gemini integration tests pass on phone + emulator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:19:42 -05:00
JordanTheJet
5176c66934 Add email tool, Gemini integration tests, secure API key handling
- Add EmailSendTool (email.send) using Android ACTION_SENDTO intent
- Add Gemini integration tests (completion, tool use, streaming)
- Move API key from hardcoded test to BuildConfig via local.properties
- Update default Gemini model from 2.0-flash to 2.5-flash
- Add email.send to AutonomyPolicy defaults (ASK)
- Register EmailSendTool in AppModule DI
- Update unit tests for new model name

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:18:05 -05:00
JordanTheJet
8099a5635a Add multi-provider support (Anthropic, OpenAI, Gemini)
- Add GeminiProvider with Gemini API function calling support
- Add ProviderManager to handle provider selection and API key management
- Update AgentLoop to use ProviderManager instead of hardcoded Anthropic
- Redesign SetupScreen with provider selection cards (radio buttons)
- Update SettingsScreen with per-provider API key management
- Update DI module to provide all three providers
- Add unit tests for GeminiProvider and ProviderManager
- Tested on emulator and physical device (Samsung Galaxy Z Flip)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:51:26 -05:00
JordanTheJet
b8f2191cbf Update .gitignore to exclude images and env files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:43:26 -05:00
JordanTheJet
c40bb58734 Add instrumented tests and expand unit test coverage (113 total)
Instrumented tests (38) run on Android emulator verifying:
- File tools: write, read, append, list, nested dirs, error handling
- Script execution: echo, pwd, date, pipes, id, timeouts
- Settings tool: battery, wifi, brightness queries
- Room database: message and fact DAOs, ConversationStore, SemanticMemory

Unit tests expanded with memory entity tests (75 total JVM tests).
All 113 tests pass with 0 failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 02:55:51 -05:00
JordanTheJet
04682e3498 Add unit test suite (68 tests across 12 test classes)
Tests cover ToolRegistry, SkillParser, AutonomyPolicy, TaskQueue,
ApprovalQueue, ToolResult, ToolParameters, ToolSchema, Messages,
StreamEvents, AgentState, and ApprovalPolicy models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:24:16 -05:00
JordanTheJet
d191d60668 Fix compilation errors and add Gradle wrapper
- Fix SSE streaming: replace inline processSSE with readLine loop
  to allow suspend emit() calls inside the flow
- Remove @Serializable from CompletionRequest (ToolApiDefinition
  is not serializable)
- Fix LocationTool type inference for suspendCancellableCoroutine
- Add gradlew/gradlew.bat and gradle-wrapper.jar

Build: assembleDebug passes, APK generated (20.7MB)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-18 14:01:38 -05:00
JordanTheJet
e57292c25d Initial implementation of CellClaw autonomous AI phone assistant
Kotlin/Android app with full project scaffold:
- Agent loop with configurable autonomy (auto/ask/deny per tool)
- Anthropic + OpenAI provider with streaming SSE and tool use
- 24 native phone tools (SMS, calls, contacts, calendar, camera,
  location, files, scripts, sensors, app automation, etc.)
- Approval queue with biometric gate and notification actions
- Room/SQLite memory (conversation history + semantic facts)
- Foreground service with persistent notification
- AccessibilityService for app automation
- Broadcast receivers (SMS, phone state, boot, battery)
- Skills system with SKILL.md parser and 2 bundled skills
- Jetpack Compose Material 3 UI (chat, setup, settings, approvals, skills)
- Hilt DI, Android Keystore for API key encryption
- Min SDK 26, target SDK 35

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-18 13:05:06 -05:00