Skip to content

Commit ad2b4c6

Browse files
committed
feat: free keyless AI providers and Termux tab cleanup
- add Pollinations (keyless default), Hugging Face and Cloudflare Workers AI providers - drop OpenCode from the built-in model list and default to the keyless model - stop the header MODEL label overlapping long model names - Termux settings no longer open other apps; buttons only copy commands - Cloudflare Account ID is stored in the vault and injected into the base URL
1 parent f10c6f7 commit ad2b4c6

6 files changed

Lines changed: 223 additions & 94 deletions

File tree

‎app/src/main/java/com/example/termux/TermuxBridgeClient.kt‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import java.util.UUID
1717
* Client for the user's own Termux Agent Room.
1818
* The endpoint and bearer token are stored locally on this device.
1919
*/
20-
data class TermuxProvider(val id: String, val name: String, val defaultModel: String, val models: List<String>, val configured: Boolean, val credentialName: String)
20+
data class TermuxProvider(val id: String, val name: String, val defaultModel: String, val models: List<String>, val configured: Boolean, val credentialName: String, val accountCredential: String = "", val keyOptional: Boolean = false)
2121
class MissingProviderCredential(val credentialName: String, val providerName: String) : IllegalStateException("Missing API key for $providerName")
2222

2323
class TermuxBridgeClient(context: Context) {
@@ -110,7 +110,9 @@ class TermuxBridgeClient(context: Context) {
110110
defaultModel = item.optString("default_model"),
111111
models = (0 until modelsJson.length()).map { modelsJson.optString(it) },
112112
configured = item.optBoolean("configured"),
113-
credentialName = item.optString("credential_name")
113+
credentialName = item.optString("credential_name"),
114+
accountCredential = item.optString("account_credential"),
115+
keyOptional = item.optBoolean("key_optional")
114116
)
115117
}
116118
}
@@ -125,7 +127,6 @@ class TermuxBridgeClient(context: Context) {
125127
/** Query the provider's live model endpoint using the entered key without saving or logging it. */
126128
suspend fun discoverModels(provider: String, apiKey: String): List<String> {
127129
require(provider.isNotBlank()) { "Select an AI provider first" }
128-
require(apiKey.isNotBlank()) { "Enter the provider API key first" }
129130
val result = mcpTool("provider_models_list", JSONObject()
130131
.put("provider", provider)
131132
.put("api_key", apiKey), 45)

0 commit comments

Comments
 (0)