Commit Graph

23 Commits

Author SHA1 Message Date
Somasundaram Mahesh
4199143de8 feat(android): UI overhaul — branded theme, onboarding, chat-style home
- Replace default purple Material 3 theme with logo-derived palette
  (crimson red primary, dark charcoal surfaces, golden accent)
- Add Instrument Serif + Inter fonts for custom typography scale
- Add first-launch onboarding flow (API key + server URL, permissions)
- Restructure navigation: 2-tab bottom nav (Home + Settings), logs
  via top bar icon, permission status indicators in top bar
- Redesign HomeScreen as chat-style interface with goal/step bubbles,
  auto-scroll, bottom input bar with send/stop buttons
- Redesign SettingsScreen with Server → Connection → Permissions sections
- Redesign LogsScreen with goal banner, step badges, timestamps
- Replace default Android icon with DroidClaw logo at all densities
- Add hasOnboarded DataStore flag with auto-connect on completion
- Fix logs navigation not clearing when switching bottom tabs
2026-02-18 22:09:32 +05:30
Sanju Sivalingam
59ee665088 revert: remove workflow automation, keep overlay and stop_goal
Remove all workflow-related code from PR #6 (input classifier,
workflow parser, notification listener, workflow CRUD handlers).
Keep the overlay, stop_goal, AbortSignal threading, and OkHttp
engine switch. Add v2 design doc for safer workflow implementation.
2026-02-18 20:39:04 +05:30
Somasundaram Mahesh
4d4b7059e4 feat: workflow automation via NotificationListenerService
Add workflow system that lets users describe automations in natural
language through the same input field. The server LLM classifies
input as either an immediate goal or a workflow rule, then:

- Parses workflow descriptions into structured trigger conditions
- Stores workflows per-user in Postgres
- Syncs workflows to device via WebSocket
- NotificationListenerService monitors notifications and triggers
  matching workflows as agent goals

Also cleans up overlay text and adds network security config.
2026-02-18 18:51:25 +05:30
Somasundaram Mahesh
45766621f2 fix(android): switch Ktor CIO engine to OkHttp for stable background WebSocket
CIO uses Java NIO selectors which Android's power management freezes
when the app is backgrounded, dropping the WebSocket connection. OkHttp
is Android-native and maintains connections through the OS network stack.
2026-02-18 18:51:24 +05:30
Somasundaram Mahesh
011e2be291 feat: agent overlay, stop-goal support, and state persistence across app kill
- Add draggable agent overlay pill (status dot + step text + stop button)
  that shows over other apps while connected. Fix ComposeView rendering
  in service context by providing a SavedStateRegistryOwner.
- Add stop_goal protocol message so the overlay/client can abort a
  running agent session; server aborts via AbortController.
- Persist screen-capture consent to SharedPreferences so it survives
  process death; restore on ConnectionService connect and Settings resume.
- Query AccessibilityManager for real service state instead of relying
  on in-process MutableStateFlow that resets on restart.
- Add overlay permission checklist item and SYSTEM_ALERT_WINDOW manifest
  entry.
- Filter DroidClaw's own overlay nodes from the accessibility tree so the
  agent never interacts with them.
2026-02-18 18:51:01 +05:30
Sanju Sivalingam
88af77ddc7 fix: configure postgres idle timeout and connection recycling for Railway
Railway proxy closes idle DB connections after ~60s, causing
CONNECTION_CLOSED errors on stale sockets. Set idle_timeout=20s and
max_lifetime=5m so postgres-js recycles connections before they die.

Also fix sendCommand to fall back to persistent device ID on reconnect.
2026-02-18 13:56:34 +05:30
Sanju Sivalingam
562d4095f0 fix(android): prevent save button from disappearing during API key editing
DataStore flow re-emissions were resetting editingApiKey via remember(apiKey),
hiding the save button mid-edit. Now uses null sentinel to track edit state
independently from stored value.
2026-02-18 12:32:26 +05:30
Sanju Sivalingam
a865c1e2f0 fix(android): add explicit connect/request timeouts to WebSocket client
CIO engine had no timeout config, causing connect failures on slower networks.
2026-02-18 11:31:47 +05:30
Sanju Sivalingam
22b13bec2f update android app default server url to production 2026-02-18 10:25:42 +05:30
Somasundaram Mahesh
5207e4ea9b Fix Settings UI reactivity, resolve compiler warnings, update .gitignore
- Make screen capture permission and battery optimization states reactive
- Add lifecycle observer to refresh battery status on resume
- Add lifecycle-runtime-compose dependency for non-deprecated LocalLifecycleOwner
- Replace deprecated LocalLifecycleOwner import
- Remove unused REQUEST_CODE constant
- Use KTX createBitmap() and bitmap[x,y] extensions
- Add misc.xml and junie.xml to .gitignore
2026-02-18 07:47:28 +05:30
Sanju Sivalingam
3769b21ed1 refactor(agent): delete preprocessor.ts (replaced by parser.ts) 2026-02-18 00:28:50 +05:30
Sanju Sivalingam
e300f04e13 feat: installed apps, stop goal, auth fixes, remote commands
- Android: fetch installed apps via PackageManager, send to server on connect
- Android: add QUERY_ALL_PACKAGES permission for full app visibility
- Android: fix duplicate Intent import, increase accessibility retry window
- Android: default server URL to ws:// instead of wss://
- Server: store installed apps in device metadata JSONB
- Server: inject installed apps context into LLM prompt
- Server: preprocessor resolves app names from device's actual installed apps
- Server: add POST /goals/stop endpoint with AbortController cancellation
- Server: rewrite session middleware to direct DB token lookup
- Server: goals route fetches user's saved LLM config from DB
- Web: show installed apps in device detail Overview tab with search
- Web: add Stop button for running goals
- Web: replace API routes with remote commands (submitGoal, stopGoal)
- Web: add error display for goal submission failures
- Shared: add InstalledApp type and apps message to protocol
2026-02-17 22:50:18 +05:30
Sanju Sivalingam
c3d6674793 feat: add 60s battery heartbeat to ConnectionService
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 20:59:33 +05:30
Sanju Sivalingam
a7738936f2 feat: extend DeviceInfo with battery, manufacturer, heartbeat
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 20:55:42 +05:30
Sanju Sivalingam
c395f9d83e feat: add DB persistence, real-time WebSocket, goal preprocessor, and Android companion app
- Add device/session/step DB persistence in server agent loop
- Add goal preprocessor for compound goals (e.g., "open YouTube and search X")
- Add step-level logging to agent loop
- Fix dashboard WebSocket auth (direct DB token lookup instead of auth.api)
- Fix web layout to use locals.session.token instead of cookie
- Add dashboard-ws.svelte.ts WebSocket store with auto-reconnect
- Rewrite devices page with direct DB queries and real-time updates
- Add device detail page with live step display and session history
- Add Android companion app resources, themes, and screen capture consent

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 20:12:41 +05:30
Sanju Sivalingam
ea707af83e fix(android): add CHANGE_NETWORK_STATE for foreground service on SDK 36
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 18:41:59 +05:30
Sanju Sivalingam
61fcecd021 fix(android): add screenHash to screen responses, handle goal_failed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 18:17:48 +05:30
Sanju Sivalingam
4e9f0e14ae feat(android): add HomeScreen, SettingsScreen, LogsScreen with bottom nav
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:55:02 +05:30
Sanju Sivalingam
516b83bd0f feat(android): add ReliableWebSocket, CommandRouter, ConnectionService
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:51:19 +05:30
Sanju Sivalingam
ac7fc85891 feat(android): add GestureExecutor and ScreenCaptureManager
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:47:10 +05:30
Sanju Sivalingam
0e8ff24e08 feat(android): add AccessibilityService, ScreenTreeBuilder, permissions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:43:42 +05:30
Sanju Sivalingam
78b605bc86 feat(android): add data models, DataStore settings, Application class
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:40:56 +05:30
Sanju Sivalingam
e22326cbd3 feat(android): add Ktor, serialization, DataStore, navigation dependencies
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:38:56 +05:30