Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / library / AGENTS.md

AGENTS.md6.0 KiBRenderedCodeRaw
1# AGENTS.md — library/ (':library')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/` + allowed shared modules. Do not root-scan.
4
5- Gradle: :library / dir: library/
6- Package roots present: intents
7- Entry files: util/Navigation.kt + util/AssistantIntent.kt (no MainActivity/Route — base library)
8- Deps: :sdk:games
9- Metadata: metadata_data/library.md (absent — libraries have none by design)
10- Rust: no / screenshotTest: no
11
12## Overview
13**Purpose:** Base library every module depends on — navigation keys, cross-app `AssistantIntent` + shared IPC DTOs (`intents/<app>`), `RoomRepository` base, messenger, backup/storage helpers, game-hub reporting.
14**How to use:** Routes implement `util/NavKey`; screens navigate via `util/Navigation.kt` (+ bottom-bar/motion/results helpers). Cross-app calls go through `AssistantIntent<In,Out>` with DTOs in `library.intents.<app>`. Room entities subclass `util/RoomViewModel`/`DatabaseHelper` patterns; backups via `BackupAgent`/`BackupHelper`/`BackupFormat`. Games report via `GameHubReporter`/`DailyStreakReporter`.
15**Entry points:** `util/Navigation.kt` → `util/NavKey` (same file) → `util/AssistantIntent.kt` → `intents/notes/` (copy-pattern) → `util/AppMessages.kt`.
16**Themes:** `res/values*/themes.xml` carries `Theme.General.Base` (window + Android 12+ splash background, light/dark + v33 twins) and `Theme.General.Translucent` (headless biometric host; keeps `windowDisablePreview` + empty splash icon). The splash icon is not here — a library cannot reference an app's icon — so build-logic generates each app's `Theme.General` as Base plus `windowSplashScreenAnimatedIcon=@mipmap/ic_launcher` (that app's generated adaptive icon).
17**Gotchas:** `util/` here is grandfathered (this IS the util library) — the no-`util/` rule applies to apps, not this module. DTO changes break every consumer — keep `intents/` backward-compatible.
18
19## Key files
20### intents/ — shared IPC DTOs (one package per app)
21- com/vayunmathur/library/intents/appstore/AppStoreData.kt
22- com/vayunmathur/library/intents/notes/NoteData.kt
23- com/vayunmathur/library/intents/notes/InsertNoteData.kt
24- com/vayunmathur/library/intents/calendar/EventData.kt
25- com/vayunmathur/library/intents/clock/ClockData.kt
26- com/vayunmathur/library/intents/contacts/ContactData.kt
27- com/vayunmathur/library/intents/email/EmailData.kt
28- com/vayunmathur/library/intents/findfamily/FamilyMemberData.kt
29- com/vayunmathur/library/intents/fooddelivery/OrderLookupData.kt
30- com/vayunmathur/library/intents/maps/DirectionsData.kt
31- com/vayunmathur/library/intents/maps/PlaceData.kt — capped place DTOs (`MapsPlaceSearchQuery`, `SavedPlacesQuery`, `PlaceData`; shared caps `MAX_PLACE_RESULTS=10`, `MAX_PLACE_TEXT_CHARS=120`)
32- com/vayunmathur/library/intents/music/MusicData.kt
33- com/vayunmathur/library/intents/games/GamesData.kt
34- com/vayunmathur/library/intents/taxi/RideEstimateData.kt
35- com/vayunmathur/library/intents/weather/WeatherData.kt
36- com/vayunmathur/library/intents/health/HealthMetricData.kt — aggregate-only health summary query/result (no record-level fields)
37- com/vayunmathur/library/intents/calculator/CalculatorData.kt
38- com/vayunmathur/library/intents/astronomy/AstronomyData.kt — `TonightQuery`/`AstronomyTonightData` (capped summary, `MAX_TONIGHT_SUMMARY_CHARS`)
39- com/vayunmathur/library/intents/weather/WeatherForecastData.kt — capped forecast query/result (`WeatherForecastQuery` days ≤5, hours ≤12; summary entries only)
40- com/vayunmathur/library/intents/travel/TravelData.kt — `TripsQuery` + summaries-only `TripSummaryData` (name, dates, status, destination count)
41- com/vayunmathur/library/intents/translate/TranslateData.kt — `TranslateQuery`/`TranslateResultData` + 1,000-in/2,000-out caps for `translate_text`
42- com/vayunmathur/library/intents/photos/PhotoData.kt — metadata-only photo search DTOs (no URI/bytes/thumbnail fields by design)
43- com/vayunmathur/library/intents/youpipe/YouPipeData.kt
44- com/vayunmathur/library/intents/files/FileData.kt
45### util/ — navigation, intents, messenger, storage, games glue
46- com/vayunmathur/library/util/Navigation.kt — `NavKey` + `MainNavigation` + `rememberNavBackStack`
47- com/vayunmathur/library/util/NavigationBottomBar.kt
48- com/vayunmathur/library/util/SiblingRoutes.kt — ordered sibling-route groups: adjacent/replace navigation (`navigateToSibling*`) so swipe/tab switches never grow the back stack; index/deep-link resolution for legacy selectors
49- com/vayunmathur/library/util/NavigationMotion.kt
50- com/vayunmathur/library/util/NavigationResults.kt
51- com/vayunmathur/library/util/AssistantIntent.kt
52- com/vayunmathur/library/util/AppMessages.kt — `AppMessages.show()` (never `Toast`)
53- com/vayunmathur/library/util/Notifications.kt
54- com/vayunmathur/library/util/RoomViewModel.kt
55- com/vayunmathur/library/util/DatabaseHelper.kt
56- com/vayunmathur/library/util/BackupAgent.kt
57- com/vayunmathur/library/util/BackupHelper.kt
58- com/vayunmathur/library/util/BackupFormat.kt
59- com/vayunmathur/library/util/DataStoreUtils.kt
60- com/vayunmathur/library/util/AppPreferencesEntry.kt
61- com/vayunmathur/library/util/GameHubReporter.kt
62- com/vayunmathur/library/util/GameHubCompose.kt
63- com/vayunmathur/library/util/DailyStreakReporter.kt
64- com/vayunmathur/library/util/DailyChallengeStore.kt
65- com/vayunmathur/library/util/Achievement.kt
66- com/vayunmathur/library/util/AchievementsManager.kt
67- com/vayunmathur/library/util/LevelStatsRepository.kt
68- com/vayunmathur/library/util/IntentHelper.kt
69- com/vayunmathur/library/util/FileDropModifier.kt — `onFileDrop` (see notes/)
70- com/vayunmathur/library/util/SecureResultReceiver.kt
71- com/vayunmathur/library/util/SharedEditableText.kt
72- com/vayunmathur/library/util/Hkdf.kt
73- com/vayunmathur/library/util/Markdown.kt
74- com/vayunmathur/library/util/Format.kt
75- com/vayunmathur/library/util/LocalizedDateNames.kt
76- com/vayunmathur/library/util/Util.kt
77### sensor/ — shared sensors
78- com/vayunmathur/library/sensor/OrientationManager.kt
79
80## Verify (this module only)
81```
82./gradlew :library:compileDevKotlin
83./gradlew :library:lint
84```