Implement MCP Servers, Webhooks, and Models screens
This commit is contained in:
1 parent
ce71aa3e68
commit
43dfbc5470
12 files changed
+1173
-1
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package com.m57.hermescontrol.data.model
|
||||
|
||||
data class McpServersResponse(
|
||||
val servers: List<McpServer>,
|
||||
)
|
||||
|
||||
data class McpServer(
|
||||
val name: String,
|
||||
val transport: String?,
|
||||
val url: String?,
|
||||
val command: String?,
|
||||
val args: List<String>?,
|
||||
val env: Map<String, String>?,
|
||||
val enabled: Boolean,
|
||||
)
|
||||
|
||||
data class McpServerToggleRequest(
|
||||
val enabled: Boolean,
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.m57.hermescontrol.data.model
|
||||
|
||||
data class ModelOptionsResponse(
|
||||
val providers: List<ModelProvider>,
|
||||
)
|
||||
|
||||
data class ModelProvider(
|
||||
val slug: String,
|
||||
val name: String,
|
||||
val is_current: Boolean?,
|
||||
val is_user_defined: Boolean?,
|
||||
val models: List<String>?,
|
||||
val total_models: Int?,
|
||||
val source: String?,
|
||||
val authenticated: Boolean?,
|
||||
val auth_type: String?,
|
||||
val warning: String?,
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.m57.hermescontrol.data.model
|
||||
|
||||
data class WebhooksResponse(
|
||||
val enabled: Boolean,
|
||||
val base_url: String?,
|
||||
val subscriptions: List<WebhookSubscription>?,
|
||||
)
|
||||
|
||||
data class WebhookSubscription(
|
||||
val name: String,
|
||||
val url: String,
|
||||
val events: List<String>?,
|
||||
)
|
||||
|
||||
data class WebhooksToggleRequest(
|
||||
val enabled: Boolean,
|
||||
)
|
||||
@@ -3,6 +3,9 @@ package com.m57.hermescontrol.data.remote
|
||||
import com.m57.hermescontrol.data.model.AchievementsResponse
|
||||
import com.m57.hermescontrol.data.model.ActiveProfileResponse
|
||||
import com.m57.hermescontrol.data.model.CronJob
|
||||
import com.m57.hermescontrol.data.model.McpServerToggleRequest
|
||||
import com.m57.hermescontrol.data.model.McpServersResponse
|
||||
import com.m57.hermescontrol.data.model.ModelOptionsResponse
|
||||
import com.m57.hermescontrol.data.model.PairingApproveRequest
|
||||
import com.m57.hermescontrol.data.model.PairingResponse
|
||||
import com.m57.hermescontrol.data.model.PairingRevokeRequest
|
||||
@@ -22,6 +25,8 @@ import com.m57.hermescontrol.data.model.UpdateProfileDescriptionRequest
|
||||
import com.m57.hermescontrol.data.model.UpdateProfileModelRequest
|
||||
import com.m57.hermescontrol.data.model.UpdateProfileSoulRequest
|
||||
import com.m57.hermescontrol.data.model.UpdateRawConfigRequest
|
||||
import com.m57.hermescontrol.data.model.WebhooksResponse
|
||||
import com.m57.hermescontrol.data.model.WebhooksToggleRequest
|
||||
import retrofit2.Response
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.DELETE
|
||||
@@ -157,4 +162,34 @@ interface HermesApiService {
|
||||
suspend fun updateRawConfig(
|
||||
@Body body: UpdateRawConfigRequest,
|
||||
): Response<Unit>
|
||||
|
||||
@GET("api/mcp/servers")
|
||||
suspend fun getMcpServers(): Response<McpServersResponse>
|
||||
|
||||
@PUT("api/mcp/servers/{name}/enabled")
|
||||
suspend fun toggleMcpServer(
|
||||
@Path("name") name: String,
|
||||
@Body body: McpServerToggleRequest,
|
||||
): Response<Unit>
|
||||
|
||||
@POST("api/mcp/servers/{name}/test")
|
||||
suspend fun testMcpServer(
|
||||
@Path("name") name: String,
|
||||
): Response<Unit>
|
||||
|
||||
@DELETE("api/mcp/servers/{name}")
|
||||
suspend fun deleteMcpServer(
|
||||
@Path("name") name: String,
|
||||
): Response<Unit>
|
||||
|
||||
@GET("api/webhooks")
|
||||
suspend fun getWebhooks(): Response<WebhooksResponse>
|
||||
|
||||
@POST("api/webhooks/enable")
|
||||
suspend fun toggleWebhooks(
|
||||
@Body body: WebhooksToggleRequest,
|
||||
): Response<Unit>
|
||||
|
||||
@GET("api/model/options")
|
||||
suspend fun getModelOptions(): Response<ModelOptionsResponse>
|
||||
}
|
||||
Reference in new issue
Block a user