package com.correx.core.tools.contract

import com.correx.core.events.types.ToolInvocationId
import kotlinx.serialization.Serializable

sealed interface ToolResult {
    @Serializable
    data class Success(
        val invocationId: ToolInvocationId,
        val output: String,
        val exitCode: Int = 0,
        val metadata: Map<String, String> = emptyMap(),
    ) : ToolResult

    @Serializable
    data class Failure(
        val invocationId: ToolInvocationId,
        val reason: String,
        val recoverable: Boolean,
    ) : ToolResult
}
