package com.correx.core.events.events

import com.correx.core.approvals.Tier
import com.correx.core.events.types.SessionId
import com.correx.core.events.types.StageId
import com.correx.core.events.types.ToolInvocationId
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
@SerialName("ToolExecutionCompleted")
data class ToolExecutionCompletedEvent(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val toolName: String,
    val receipt: ToolReceipt,
) : EventPayload

@Serializable
@SerialName("ToolExecutionFailed")
data class ToolExecutionFailedEvent(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val toolName: String,
    val reason: String,
) : EventPayload

@Serializable
@SerialName("ToolExecutionRejected")
data class ToolExecutionRejectedEvent(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val toolName: String,
    val tier: Tier,
    val reason: String,
) : EventPayload

@Serializable
@SerialName("ToolExecutionStarted")
data class ToolExecutionStartedEvent(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val toolName: String,
) : EventPayload

@Serializable
@SerialName("ToolInvocationRequested")
data class ToolInvocationRequestedEvent(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val stageId: StageId,
    val toolName: String,
    val tier: Tier,
    val request: ToolRequest,
) : EventPayload

@Serializable
@SerialName("ToolInvoked")
data class ToolInvokedEvent(
    val toolId: String,
) : EventPayload
