package il.co.organicai.agent

/**
 * On-device generation via Gemini Nano (ML Kit GenAI). Free, keyless, and the text
 * never leaves the phone — this is what removes the "needs a Gemini API key" blocker
 * for mobile agents.
 *
 * SCAFFOLD: the ML Kit GenAI beta exposes summarize / rewrite / proofread today; a
 * general Prompt API is rolling out per device. This wraps the intended call so the
 * rest of the app can depend on a stable surface while the beta settles. Nano only
 * runs on recent Tensor/Snapdragon/Dimensity hardware; callers must handle
 * isAvailable() == false by falling back to the worker's cloud AI.
 */
object NanoAi {

    /** Whether this device can run Nano at all (HW + model downloaded via AICore). */
    suspend fun isAvailable(): Boolean {
        // TODO: query the ML Kit GenAI feature-status API (downloadable model check).
        return false
    }

    /**
     * Rewrite/generate a social post in the user's voice, on device.
     * @param brief what to say; @param tone e.g. "friendly", "professional".
     */
    suspend fun draftPost(brief: String, tone: String = "friendly"): String? {
        if (!isAvailable()) return null
        // TODO: ML Kit Rewriting API — new Rewriter(options).rewrite(brief).
        // Kept as a stub so callers can wire the fallback path now.
        return null
    }
}
