Package-level declarations

Types

Link copied to clipboard
interface AiConsentStore

Where the AI-consent choice persists. Same seam shape as com.siddharth.kmp.designsystem.ThemeStore: the default is in-memory, an app binds a persistent implementation (DataStore/Settings) in Koin so the choice survives process death.

Link copied to clipboard
class AiSettingsState(modelManager: ModelManager, manifest: List<ModelManifestEntry>, onDeviceLlm: OnDeviceLlm, getKey: (ProviderId) -> String?, setKey: (ProviderId, String?) -> Unit, scope: CoroutineScope, consentStore: AiConsentStore = InMemoryAiConsentStore, providerFactory: (ProviderId, String) -> AiProvider? = ::defaultCloudProvider)

State holder behind AiSettingsSection — the ModelManager settings screen the toolkit never shipped one for. Same shape as com.siddharth.kmp.designsystem.ThemeController: a plain class, StateFlow-exposed, testable with fakes in commonTest, bound as a Koin screen-scoped instance by the consuming app.

Link copied to clipboard
data class AiSettingsUiState(val aiConsentGiven: Boolean, val onDeviceCapabilities: AiCapabilities?, val models: List<OnDeviceModelRow>, val providers: List<ProviderRow>, val selectedProvider: ProviderId)
Link copied to clipboard

Default seam: holds the choice for the process lifetime only.

Link copied to clipboard

Outcome of the settings screen's "test key" action for one cloud provider.

Link copied to clipboard
data class OnDeviceModelRow(val info: ModelInfo, val requiresLicenseAck: Boolean)

One row in the on-device model list: the manager's live ModelInfo plus its manifest metadata.

Link copied to clipboard
data class ProviderRow(val providerId: ProviderId, val hasKey: Boolean, val testOutcome: KeyTestOutcome = KeyTestOutcome.UNTESTED, val testFailure: AiFailure? = null)

One row in the cloud-provider picker: whether a key is saved, and the last "test key" outcome.

Functions

Link copied to clipboard
fun AiSettingsSection(uiState: AiSettingsUiState, onConsentChange: (Boolean) -> Unit, onStartDownload: (modelId: String, licenseAcknowledged: Boolean) -> Unit, onPauseDownload: (modelId: String) -> Unit, onDeleteModel: (modelId: String) -> Unit, onSelectProvider: (ProviderId) -> Unit, onProviderKeyChange: (ProviderId, String) -> Unit, onClearProviderKey: (ProviderId) -> Unit, onTestProviderKey: (ProviderId) -> Unit, modifier: Modifier = Modifier)

The settings screen ModelManager/AiProvider never had (see the lane brief): on-device model download/pause/resume/delete with progress and license gating, plus cloud-provider key entry with a real "test key" call. Pure render — every action is a callback into AiSettingsState so this composable stays testable via runComposeUiTest with a fake AiSettingsUiState and no live com.siddharth.kmp.ai.ModelManager/com.siddharth.kmp.llmchat.AiProvider.