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

Modern-Apps.git / library / AGENTS.md

AGENTS.md5.3 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**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.
17
18## Key files
19### intents/ — shared IPC DTOs (one package per app)
20- com/vayunmathur/library/intents/appstore/AppStoreData.kt
21- com/vayunmathur/library/intents/notes/NoteData.kt
22- com/vayunmathur/library/intents/notes/InsertNoteData.kt
23- com/vayunmathur/library/intents/calendar/EventData.kt
24- com/vayunmathur/library/intents/clock/ClockData.kt
25- com/vayunmathur/library/intents/contacts/ContactData.kt
26- com/vayunmathur/library/intents/email/EmailData.kt
27- com/vayunmathur/library/intents/findfamily/FamilyMemberData.kt
28- com/vayunmathur/library/intents/fooddelivery/OrderLookupData.kt
29- com/vayunmathur/library/intents/maps/DirectionsData.kt
30- com/vayunmathur/library/intents/maps/PlaceData.kt — capped place DTOs (`MapsPlaceSearchQuery`, `SavedPlacesQuery`, `PlaceData`; shared caps `MAX_PLACE_RESULTS=10`, `MAX_PLACE_TEXT_CHARS=120`)
31- com/vayunmathur/library/intents/music/MusicData.kt
32- com/vayunmathur/library/intents/games/GamesData.kt
33- com/vayunmathur/library/intents/taxi/RideEstimateData.kt
34- com/vayunmathur/library/intents/weather/WeatherData.kt
35- com/vayunmathur/library/intents/health/HealthMetricData.kt — aggregate-only health summary query/result (no record-level fields)
36- com/vayunmathur/library/intents/calculator/CalculatorData.kt
37- com/vayunmathur/library/intents/astronomy/AstronomyData.kt — `TonightQuery`/`AstronomyTonightData` (capped summary, `MAX_TONIGHT_SUMMARY_CHARS`)
38- com/vayunmathur/library/intents/weather/WeatherForecastData.kt — capped forecast query/result (`WeatherForecastQuery` days ≤5, hours ≤12; summary entries only)
39- com/vayunmathur/library/intents/travel/TravelData.kt — `TripsQuery` + summaries-only `TripSummaryData` (name, dates, status, destination count)
40- com/vayunmathur/library/intents/translate/TranslateData.kt — `TranslateQuery`/`TranslateResultData` + 1,000-in/2,000-out caps for `translate_text`
41- com/vayunmathur/library/intents/photos/PhotoData.kt — metadata-only photo search DTOs (no URI/bytes/thumbnail fields by design)
42- com/vayunmathur/library/intents/youpipe/YouPipeData.kt
43- com/vayunmathur/library/intents/files/FileData.kt
44### util/ — navigation, intents, messenger, storage, games glue
45- com/vayunmathur/library/util/Navigation.kt — `NavKey` + `MainNavigation` + `rememberNavBackStack`
46- com/vayunmathur/library/util/NavigationBottomBar.kt
47- com/vayunmathur/library/util/NavigationMotion.kt
48- com/vayunmathur/library/util/NavigationResults.kt
49- com/vayunmathur/library/util/AssistantIntent.kt
50- com/vayunmathur/library/util/AppMessages.kt — `AppMessages.show()` (never `Toast`)
51- com/vayunmathur/library/util/Notifications.kt
52- com/vayunmathur/library/util/RoomViewModel.kt
53- com/vayunmathur/library/util/DatabaseHelper.kt
54- com/vayunmathur/library/util/BackupAgent.kt
55- com/vayunmathur/library/util/BackupHelper.kt
56- com/vayunmathur/library/util/BackupFormat.kt
57- com/vayunmathur/library/util/DataStoreUtils.kt
58- com/vayunmathur/library/util/AppPreferencesEntry.kt
59- com/vayunmathur/library/util/GameHubReporter.kt
60- com/vayunmathur/library/util/GameHubCompose.kt
61- com/vayunmathur/library/util/DailyStreakReporter.kt
62- com/vayunmathur/library/util/DailyChallengeStore.kt
63- com/vayunmathur/library/util/Achievement.kt
64- com/vayunmathur/library/util/AchievementsManager.kt
65- com/vayunmathur/library/util/LevelStatsRepository.kt
66- com/vayunmathur/library/util/IntentHelper.kt
67- com/vayunmathur/library/util/FileDropModifier.kt — `onFileDrop` (see notes/)
68- com/vayunmathur/library/util/SecureResultReceiver.kt
69- com/vayunmathur/library/util/SharedEditableText.kt
70- com/vayunmathur/library/util/Hkdf.kt
71- com/vayunmathur/library/util/Markdown.kt
72- com/vayunmathur/library/util/Format.kt
73- com/vayunmathur/library/util/LocalizedDateNames.kt
74- com/vayunmathur/library/util/Util.kt
75### sensor/ — shared sensors
76- com/vayunmathur/library/sensor/OrientationManager.kt
77
78## Verify (this module only)
79```
80./gradlew :library:compileDevKotlin
81./gradlew :library:lint
82```