Back to list
mrndstvndv

search-provider

by mrndstvndv

1🍴 1📅 Jan 20, 2026

SKILL.md


name: search-provider description: Search app provider system - interface definition (id, displayName, refreshSignal, initialize, canHandle, query, dispose), lifecycle diagram, 8 available providers (AppList, WebSearch, FileSearch, Contacts, Calculator, Settings, TextUtils, Termux), registration in MainActivity.

Provider System

The Provider System is the core abstraction that powers all search functionality. Each search source implements the Provider interface.

Provider Interface

// Location: app/src/main/java/com/mrndstvndv/search/provider/Provider.kt

interface Provider {
    val id: String                        // Unique identifier (e.g., "app-list")
    val displayName: String               // Human-readable name
    val refreshSignal: SharedFlow<Unit>   // Emits when provider needs refresh
    
    fun initialize()                      // Heavy setup (called once)
    fun canHandle(query: Query): Boolean  // Filter queries this provider handles
    suspend fun query(query: Query): List<ProviderResult>  // Execute search
    fun dispose()                         // Cleanup resources
}

Provider Lifecycle

┌─────────────────────────────────────────────────────────────────────┐
│                        PROVIDER LIFECYCLE                           │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   ┌──────────────┐                                                  │
│   │   Created    │  Provider instantiated in MainActivity          │
│   └──────┬───────┘                                                  │
│          │                                                          │
│          ▼                                                          │
│   ┌──────────────┐                                                  │
│   │ initialize() │  Heavy setup: load data, connect to repos       │
│   └──────┬───────┘                                                  │
│          │                                                          │
│          ▼                                                          │
│   ┌──────────────────────────────────────────────────────────┐     │
│   │                    QUERY LOOP                             │     │
│   │                                                           │     │
│   │   canHandle(query)? ──yes──► query(q) ──► Return results  │     │
│   │         ▲                                      │          │     │
│   │         └──────────── new query ───────────────┘          │     │
│   │                                                           │     │
│   └──────────────────────────────────────────────────────────┘     │
│          │                                                          │
│          │ Activity destroyed                                       │
│          ▼                                                          │
│   ┌──────────────┐                                                  │
│   │   dispose()  │  Cleanup: cancel jobs, release resources        │
│   └──────────────┘                                                  │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

Available Providers

ProviderIDDescriptionKey Features
AppListProviderapp-listInstalled applicationsFuzzy matching, AI queries
WebSearchProviderweb-searchWeb search enginesMultiple engines, quicklinks
FileSearchProviderfile-searchLocal file searchFTS4 index, thumbnails
ContactsProvidercontactsDevice contactsPhone/SIM numbers, actions
CalculatorProvidercalculatorMath expressionsExpression parsing
SettingsProvidersystem-settingsSystem settings shortcutsDev options toggle (Shizuku)
TextUtilitiesProvidertext-utilitiesText transformationsBase64, URL encode/decode
TermuxProvidertermuxTerminal commandsCustom Termux execution

Provider File Locations

ProviderLocation
AppListProviderprovider/apps/AppListProvider.kt
WebSearchProviderprovider/websearch/WebSearchProvider.kt
FileSearchProviderprovider/files/FileSearchProvider.kt
ContactsProviderprovider/contacts/ContactsProvider.kt
CalculatorProviderprovider/calculator/CalculatorProvider.kt
SettingsProviderprovider/settings/SettingsProvider.kt
TextUtilitiesProviderprovider/textutils/TextUtilitiesProvider.kt
TermuxProviderprovider/termux/TermuxProvider.kt

Provider Registration

Providers are instantiated and registered in MainActivity.kt (around line 150):

val providers = remember {
    listOf(
        AppListProvider(context, settingsRepository, ...),
        WebSearchProvider(context, settingsRepository, ...),
        FileSearchProvider(context, fileSearchRepository, ...),
        ContactsProvider(context, ...),
        CalculatorProvider(),
        SettingsProvider(context, ...),
        TextUtilitiesProvider(settingsRepository),
        TermuxProvider(context, settingsRepository)
    )
}

Adding a New Provider

See the search-guides skill for step-by-step instructions on implementing and registering a new provider.

  • search-overview - Project overview and architecture
  • search-dataflow - How queries flow through providers
  • search-guides - Step-by-step guide for adding providers

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon