Package-level declarations

Types

Link copied to clipboard

Coordinates AndroidServerSetupDownloadGuard behavior in the SDAI presentation layer.

Link copied to clipboard

Provides the NoOpServerSetupDownloadGuard singleton used by the SDAI presentation layer.

Link copied to clipboard

Defines the ServerSetupDownloadGuard contract for the SDAI presentation layer.

Link copied to clipboard
sealed interface ServerSetupEffect : MviEffect

Defines the ServerSetupEffect contract for the SDAI presentation layer.

Link copied to clipboard
sealed interface ServerSetupIntent : MviIntent

Defines the ServerSetupIntent contract for the SDAI presentation layer.

Link copied to clipboard
internal class ServerSetupIntentProcessor(val router: ServerSetupRouter, val linksProvider: LinksProvider, val currentState: () -> ServerSetupState, val updateState: ((ServerSetupState) -> ServerSetupState) -> Unit, val emitEffect: (ServerSetupEffect) -> Unit, val localModelDownloadClickReducer: (ServerSetupState.LocalModel) -> Unit, val deleteLocalModel: (String) -> Unit, val download: (String, String) -> Unit, val validateAndConnectToServer: () -> Unit, val connectToServer: () -> Unit)

Coordinates ServerSetupIntentProcessor behavior in the SDAI presentation layer.

Link copied to clipboard

Coordinates ServerSetupLink behavior in the SDAI presentation layer.

Link copied to clipboard
data class ServerSetupState(val showBackNavArrow: Boolean = false, val step: ServerSetupState.Step = Step.SOURCE, val mode: ServerSource = ServerSource.AUTOMATIC1111, val allowedModes: List<ServerSource> = remoteSetupSources, val allowLocalCustomModels: Boolean = true, val modal: ServerSetupState.Modal = Modal.None, val loadingConfiguration: Boolean = true, val serverUrl: String = "", val swarmUiUrl: String = "", val hordeApiKey: String = "", val huggingFaceApiKey: String = "", val openAiApiKey: String = "", val stabilityAiApiKey: String = "", val hordeDefaultApiKey: Boolean = false, val demoMode: Boolean = false, val demoModeUrl: String = "", val authType: ServerSetupState.AuthType = AuthType.ANONYMOUS, val login: String = "", val password: String = "", val huggingFaceModels: List<String> = emptyList(), val huggingFaceModel: String = HuggingFaceModel.default.alias, val localOnnxModels: List<ServerSetupState.LocalModel> = emptyList(), val localOnnxCustomModel: Boolean = false, val localOnnxCustomModelPath: String = "", val localMediaPipeModels: List<ServerSetupState.LocalModel> = emptyList(), val localMediaPipeCustomModel: Boolean = false, val localMediaPipeCustomModelPath: String = "", val passwordVisible: Boolean = false, val serverUrlValidationError: ServerSetupState.ValidationError? = null, val swarmUiUrlValidationError: ServerSetupState.ValidationError? = null, val loginValidationError: ServerSetupState.ValidationError? = null, val passwordValidationError: ServerSetupState.ValidationError? = null, val hordeApiKeyValidationError: ServerSetupState.ValidationError? = null, val huggingFaceApiKeyValidationError: ServerSetupState.ValidationError? = null, val openAiApiKeyValidationError: ServerSetupState.ValidationError? = null, val stabilityAiApiKeyValidationError: ServerSetupState.ValidationError? = null, val localCustomOnnxPathValidationError: ServerSetupState.ValidationError? = null, val localCustomMediaPipePathValidationError: ServerSetupState.ValidationError? = null) : MviState

Carries ServerSetupState data through the SDAI presentation layer.

Link copied to clipboard
data class ServerSetupStrings(val title: String = Localization.string("title_server_setup"), val next: String = Localization.string("next"), val connect: String = Localization.string("action_connect"), val setup: String = Localization.string("action_setup"), val backContentDescription: String = Localization.string("action_back"), val loadingConfiguration: String = Localization.string("splash_status_fetching"), val communicatingTitle: String = Localization.string("communicating_progress_title"), val communicatingSubtitle: String = Localization.string("communicating_progress_sub_title"), val errorTitle: String = Localization.string("error_title"), val ok: String = Localization.string("ok"), val cancel: String = Localization.string("cancel"), val connectLocalHostTitle: String = Localization.string("setup_localhost_url_title"), val connectLocalHostText: String = Localization.string("setup_localhost_url_text"), val sourceTitle: String = Localization.string("srv_step_1"), val configureTitle: String = Localization.string("srv_step_2"), val sourceSubtitle: String = "", val serverUrl: String = Localization.string("hint_server_url"), val apiKey: String = Localization.string("hint_server_horde_api_key"), val model: String = Localization.string("hint_hugging_face_model"), val authTitle: String = Localization.string("auth_title"), val anonymous: String = Localization.string("auth_anonymous"), val httpBasic: String = Localization.string("auth_http_basic"), val login: String = Localization.string("hint_login"), val password: String = Localization.string("hint_password"), val showPassword: String = Localization.string("action_show_password"), val hidePassword: String = Localization.string("action_hide_password"), val instructions: String = Localization.string("settings_item_instructions"), val demoMode: String = Localization.string("settings_item_demo"), val useDefaultHordeKey: String = Localization.string("hint_server_horde_use_default_api_key"), val hordeAbout: String = Localization.string("hint_server_horde_about"), val hordeGetKey: String = Localization.string("hint_server_horde_get_api_key"), val huggingFaceAbout: String = Localization.string("hint_hugging_face_about"), val openAiAbout: String = Localization.string("hint_open_ai_about"), val stabilityAbout: String = Localization.string("hint_stability_ai_about"), val automaticTitle: String = Localization.string("srv_type_own"), val automaticFormTitle: String = Localization.string("hint_server_setup_title"), val automaticSubtitle: String = Localization.string("hint_server_setup_sub_title"), val automaticHint: String = Localization.string("hint_args_warning"), val demoHint: String = Localization.string("hint_demo_mode"), val swarmTitle: String = Localization.string("srv_type_swarm_ui"), val swarmFormTitle: String = Localization.string("hint_swarm_ui_title"), val swarmSubtitle: String = Localization.string("hint_swarm_ui_sub_title"), val swarmHint: String = Localization.string("hint_args_swarm_ui_warning"), val automaticValidUrls: String = Localization.string("hint_valid_urls", "7860"), val swarmValidUrls: String = Localization.string("hint_valid_urls", "7801"), val hordeUsage: String = Localization.string("hint_server_horde_usage"), val hordeTitle: String = Localization.string("hint_server_horde_title"), val hordeSubtitle: String = Localization.string("hint_server_horde_sub_title"), val huggingFaceTitle: String = Localization.string("hint_hugging_face_title"), val huggingFaceSubtitle: String = Localization.string("hint_hugging_face_sub_title"), val openAiTitle: String = Localization.string("hint_open_ai_title"), val openAiSubtitle: String = Localization.string("hint_open_ai_sub_title"), val stabilityTitle: String = Localization.string("hint_stability_ai_title"), val stabilitySubtitle: String = Localization.string("hint_stability_ai_sub_title"), val localDiffusionTitle: String = Localization.string("hint_local_diffusion_title"), val localDiffusionSubtitle: String = Localization.string("hint_local_diffusion_sub_title"), val mediaPipeTitle: String = Localization.string("hint_mediapipe_title"), val mediaPipeSubtitle: String = Localization.string("hint_mediapipe_sub_title"), val localWarning: String = Localization.string("hint_local_diffusion_warning"), val localCustomSwitch: String = Localization.string("model_local_custom_switch"), val localPermissionHeader: String = Localization.string("model_local_permission_header"), val localPermissionTitle: String = Localization.string("model_local_permission_title"), val localPermissionButton: String = Localization.string("model_local_permission_button"), val localPathHeader: String = Localization.string("model_local_path_header"), val localPathTitle: String = Localization.string("model_local_path_title"), val localPathButton: String = Localization.string("model_local_path_button"), val localCustomTitle: String = Localization.string("model_local_custom_title"), val localCustomSubtitle: String = Localization.string("model_local_custom_sub_title"), val download: String = Localization.string("download"), val delete: String = Localization.string("delete"), val retry: String = Localization.string("retry"), val downloadFailed: String = Localization.string("error_download_fail"), val reset: String = Localization.string("action_reset"), val deleteLocalModelTitle: String = Localization.string("interaction_delete_local_model_title"))

Carries ServerSetupStrings data through the SDAI presentation layer.

Link copied to clipboard
internal data class ServerSetupValidationResult(val isValid: Boolean, val state: ServerSetupState)

Carries ServerSetupValidationResult data through the SDAI presentation layer.

Link copied to clipboard
class ServerSetupViewModel(val launchSource: LaunchSource = LaunchSource.SPLASH, val dispatchersProvider: DispatchersProvider, val buildInfoProvider: BuildInfoProvider, val getConfigurationUseCase: GetConfigurationUseCase, val getLocalOnnxModelsUseCase: GetLocalOnnxModelsUseCase, val getLocalMediaPipeModelsUseCase: GetLocalMediaPipeModelsUseCase, val fetchHuggingFaceModelsUseCase: FetchHuggingFaceModelsUseCase, val urlValidator: UrlValidator, val stringValidator: CommonStringValidator, val filePathValidator: FilePathValidator, val connectToA1111UseCase: ConnectToA1111UseCase, val connectToSwarmUiUseCase: ConnectToSwarmUiUseCase, val connectToHordeUseCase: ConnectToHordeUseCase, val connectToHuggingFaceUseCase: ConnectToHuggingFaceUseCase, val connectToLocalDiffusionUseCase: ConnectToLocalDiffusionUseCase, val connectToMediaPipeUseCase: ConnectToMediaPipeUseCase, val connectToOpenAiUseCase: ConnectToOpenAiUseCase, val connectToStabilityAiUseCase: ConnectToStabilityAiUseCase, val downloadModelUseCase: DownloadModelUseCase, val deleteModelUseCase: DeleteModelUseCase, val downloadGuard: ServerSetupDownloadGuard, val linksProvider: LinksProvider, val preferenceManager: PreferenceManager, val router: ServerSetupRouter, val onError: (Throwable) -> Unit = {}) : BaseMviViewModel<ServerSetupState, ServerSetupIntent, ServerSetupEffect>

Coordinates ServerSetupViewModel behavior in the SDAI presentation layer.

Properties

Link copied to clipboard

Exposes the ServerSetupState value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the HORDE_DEFAULT_API_KEY value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the HUGGING_FACE_MODELS_TIMEOUT_MILLIS value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the ServerSource value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the ServerSetupState value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the localGenerationSources value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the ServerSetupState value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the ServerSetupState value used by the SDAI presentation layer.

Functions

Link copied to clipboard
internal fun AuthFields(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the AuthFields UI for the SDAI presentation layer.

Link copied to clipboard
internal fun Automatic1111Form(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the Automatic1111Form UI for the SDAI presentation layer.

Link copied to clipboard
internal fun ConfigurationStep(state: ServerSetupState, strings: ServerSetupStrings, listState: LazyListState, processIntent: (ServerSetupIntent) -> Unit, modifier: Modifier = Modifier)

Renders the ConfigurationStep UI for the SDAI presentation layer.

Link copied to clipboard

Renders the ConfigurationStepBar UI for the SDAI presentation layer.

Link copied to clipboard
internal fun FormTitle(title: String, subtitle: String? = null)

Renders the FormTitle UI for the SDAI presentation layer.

Link copied to clipboard

Executes the hasCommonSelectedCustomModel step in the SDAI presentation layer.

Link copied to clipboard
internal fun HintText(text: String, modifier: Modifier = Modifier)

Renders the HintText UI for the SDAI presentation layer.

Link copied to clipboard
internal fun HordeForm(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the HordeForm UI for the SDAI presentation layer.

Link copied to clipboard
internal fun HuggingFaceForm(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the HuggingFaceForm UI for the SDAI presentation layer.

Link copied to clipboard

Executes the isItemFullyVisible step in the SDAI presentation layer.

Link copied to clipboard

Executes the isLocalGenerationSetupAvailable step in the SDAI presentation layer.

Executes the isLocalGenerationSetupAvailable step in the SDAI presentation layer.

Executes the isLocalGenerationSetupAvailable step in the SDAI presentation layer.

Link copied to clipboard

Renders the LocalCustomModelPathForm UI for the SDAI presentation layer.

Link copied to clipboard
internal fun LocalGenerationForm(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the LocalGenerationForm UI for the SDAI presentation layer.

Link copied to clipboard
internal fun LocalModelItem(model: ServerSetupState.LocalModel, selected: Boolean, strings: ServerSetupStrings, onSelect: () -> Unit, onAction: () -> Unit)

Renders the LocalModelItem UI for the SDAI presentation layer.

Link copied to clipboard

Renders the LocalOnnxFolderStructure UI for the SDAI presentation layer.

Link copied to clipboard

Executes the function step in the SDAI presentation layer.

Link copied to clipboard

Executes the function step in the SDAI presentation layer.

Link copied to clipboard

Converts SDAI data with mapToCommonSetupModels.

Link copied to clipboard

Executes the function step in the SDAI presentation layer.

Link copied to clipboard

Executes the function step in the SDAI presentation layer.

Link copied to clipboard
internal fun OpenAiForm(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the OpenAiForm UI for the SDAI presentation layer.

Link copied to clipboard
private fun RemoteFormScaffold(title: String, subtitle: String, content: @Composable () -> Unit)

Renders the RemoteFormScaffold UI for the SDAI presentation layer.

Link copied to clipboard
fun ServerSetupContent(state: ServerSetupState, processIntent: (ServerSetupIntent) -> Unit, modifier: Modifier = Modifier, strings: ServerSetupStrings = ServerSetupStrings())

Renders the ServerSetupContent UI for the SDAI presentation layer.

Link copied to clipboard
internal fun ServerSetupLoading(text: String, modifier: Modifier = Modifier)

Renders the ServerSetupLoading UI for the SDAI presentation layer.

Link copied to clipboard
internal actual fun ServerSetupLocalPathPickerButton(modifier: Modifier, text: String, onPathSelected: (String) -> Unit)

Renders the ServerSetupLocalPathPickerButton UI for the SDAI presentation layer.

internal expect fun ServerSetupLocalPathPickerButton(modifier: Modifier, text: String, onPathSelected: (String) -> Unit)

Renders the ServerSetupLocalPathPickerButton UI for the SDAI presentation layer.

internal actual fun ServerSetupLocalPathPickerButton(modifier: Modifier, text: String, onPathSelected: (String) -> Unit)

Renders the ServerSetupLocalPathPickerButton UI for the SDAI presentation layer.

Link copied to clipboard

Renders the ServerSetupModal UI for the SDAI presentation layer.

Link copied to clipboard
internal fun SettingsAction(text: String, icon: ImageVector, onClick: () -> Unit)

Renders the SettingsAction UI for the SDAI presentation layer.

Link copied to clipboard

Executes the setupAllowedModes step in the SDAI presentation layer.

Link copied to clipboard
internal fun SetupTextField(value: String, onValueChange: (String) -> Unit, label: String, modifier: Modifier = Modifier, enabled: Boolean = true, error: String? = null, keyboardType: KeyboardType = KeyboardType.Text, visualTransformation: VisualTransformation = VisualTransformation.None, trailingIcon: @Composable () -> Unit? = null)

Renders the SetupTextField UI for the SDAI presentation layer.

Link copied to clipboard
internal fun SourceModeItem(source: ServerSource, selected: Boolean, strings: ServerSetupStrings, onClick: () -> Unit)

Renders the SourceModeItem UI for the SDAI presentation layer.

Link copied to clipboard
internal fun SourceSelectionStep(state: ServerSetupState, strings: ServerSetupStrings, listState: LazyListState, processIntent: (ServerSetupIntent) -> Unit, modifier: Modifier = Modifier)

Renders the SourceSelectionStep UI for the SDAI presentation layer.

Link copied to clipboard
internal fun StabilityAiForm(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the StabilityAiForm UI for the SDAI presentation layer.

Link copied to clipboard

Executes the subtitle step in the SDAI presentation layer.

Link copied to clipboard
internal fun SwarmUiForm(state: ServerSetupState, strings: ServerSetupStrings, processIntent: (ServerSetupIntent) -> Unit)

Renders the SwarmUiForm UI for the SDAI presentation layer.

Link copied to clipboard
internal fun SwitchRow(text: String, icon: ImageVector, checked: Boolean, onCheckedChange: (Boolean) -> Unit)

Renders the SwitchRow UI for the SDAI presentation layer.

Link copied to clipboard

Executes the title step in the SDAI presentation layer.

Link copied to clipboard
fun Configuration.toServerSetupState(allowedModes: List<ServerSource>, huggingFaceModels: List<String>, localOnnxModels: List<LocalAiModel> = emptyList(), localMediaPipeModels: List<LocalAiModel> = emptyList(), allowLocalCustomModels: Boolean = true, demoModeUrl: String = "", showBackNavArrow: Boolean = false): ServerSetupState

Converts SDAI data with toServerSetupState.

Link copied to clipboard
internal fun ServerSetupLink.url(linksProvider: LinksProvider): String

Executes the url step in the SDAI presentation layer.

Link copied to clipboard

Executes the validateApiKey step in the SDAI presentation layer.

Link copied to clipboard
private fun ServerSetupState.validateLocalModel(customModel: Boolean, customModelPath: String, hasDownloadedSelection: Boolean, filePathValidator: FilePathValidator, update: ServerSetupState.(ServerSetupState.ValidationError?) -> ServerSetupState): ServerSetupValidationResult

Executes the validateLocalModel step in the SDAI presentation layer.

Link copied to clipboard

Executes the validateServerSetup step in the SDAI presentation layer.

Link copied to clipboard

Executes the validateServerUrlAndCredentials step in the SDAI presentation layer.

Link copied to clipboard

Executes the function step in the SDAI presentation layer.