This commit is contained in:
8 files changed
+1066
-88
No files matched your search
@@ -2,6 +2,7 @@ package com.m57.hermescontrol.data.ws.contract
|
||||
|
||||
import com.m57.hermescontrol.data.ws.WsMethods
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.json.JsonElement
|
||||
|
||||
class RpcMethod<P, R>(
|
||||
val name: String,
|
||||
@@ -59,6 +60,56 @@ object RpcMethods {
|
||||
SessionCorrectionResult.serializer(),
|
||||
)
|
||||
|
||||
// Passthrough JsonElement results: callers keep their existing legacy parsers.
|
||||
val SESSION_LIST: RpcMethod<SessionListParams, JsonElement> =
|
||||
RpcMethod(
|
||||
WsMethods.SESSION_LIST,
|
||||
SessionListParams.serializer(),
|
||||
JsonElement.serializer(),
|
||||
)
|
||||
|
||||
val SESSION_BRANCH: RpcMethod<SessionBranchParams, JsonElement> =
|
||||
RpcMethod(
|
||||
WsMethods.SESSION_BRANCH,
|
||||
SessionBranchParams.serializer(),
|
||||
JsonElement.serializer(),
|
||||
)
|
||||
|
||||
val SESSION_BRANCH_WHOLE: RpcMethod<SessionBranchWholeParams, JsonElement> =
|
||||
RpcMethod(
|
||||
WsMethods.SESSION_BRANCH_WHOLE,
|
||||
SessionBranchWholeParams.serializer(),
|
||||
JsonElement.serializer(),
|
||||
)
|
||||
|
||||
val SESSION_COMPRESS: RpcMethod<SessionCompressParams, JsonElement> =
|
||||
RpcMethod(
|
||||
WsMethods.SESSION_COMPRESS,
|
||||
SessionCompressParams.serializer(),
|
||||
JsonElement.serializer(),
|
||||
)
|
||||
|
||||
val SESSION_CONTEXT_BREAKDOWN: RpcMethod<SessionIdParams, JsonElement> =
|
||||
RpcMethod(
|
||||
WsMethods.SESSION_CONTEXT_BREAKDOWN,
|
||||
SessionIdParams.serializer(),
|
||||
JsonElement.serializer(),
|
||||
)
|
||||
|
||||
val SESSION_USAGE: RpcMethod<SessionIdParams, JsonElement> =
|
||||
RpcMethod(
|
||||
WsMethods.SESSION_USAGE,
|
||||
SessionIdParams.serializer(),
|
||||
JsonElement.serializer(),
|
||||
)
|
||||
|
||||
val PROMPT_BTW: RpcMethod<PromptBtwParams, PromptBtwResult> =
|
||||
RpcMethod(
|
||||
WsMethods.PROMPT_BTW,
|
||||
PromptBtwParams.serializer(),
|
||||
PromptBtwResult.serializer(),
|
||||
)
|
||||
|
||||
/** Every typed method. GatewayContractTest iterates this; future migrations append here. */
|
||||
val all: List<RpcMethod<*, *>> =
|
||||
listOf(
|
||||
@@ -69,5 +120,12 @@ object RpcMethods {
|
||||
SESSION_INTERRUPT,
|
||||
SESSION_STEER,
|
||||
SESSION_REDIRECT,
|
||||
SESSION_LIST,
|
||||
SESSION_BRANCH,
|
||||
SESSION_BRANCH_WHOLE,
|
||||
SESSION_COMPRESS,
|
||||
SESSION_CONTEXT_BREAKDOWN,
|
||||
SESSION_USAGE,
|
||||
PROMPT_BTW,
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.m57.hermescontrol.data.ws.contract
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data object SessionListParams
|
||||
|
||||
@Serializable
|
||||
data class SessionIdParams(
|
||||
@SerialName("session_id") val sessionId: String,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class SessionBranchParams(
|
||||
@SerialName("session_id") val sessionId: String,
|
||||
@SerialName("name") val name: String? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class SessionBranchWholeParams(
|
||||
@SerialName("session_id") val sessionId: String,
|
||||
@SerialName("name") val name: String? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class SessionCompressParams(
|
||||
@SerialName("session_id") val sessionId: String,
|
||||
@SerialName("focus_topic") val focusTopic: String? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class PromptBtwParams(
|
||||
@SerialName("session_id") val sessionId: String,
|
||||
@SerialName("text") val text: String,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class PromptBtwResult(
|
||||
@SerialName("task_id") val taskId: String? = null,
|
||||
)
|
||||
Reference in new issue
Block a user