package com.correx.core.events.events

import com.correx.core.approvals.Tier
import com.correx.core.events.serialization.AnyMapSerializer
import com.correx.core.events.types.ToolInvocationId
import kotlinx.datetime.Instant
import kotlinx.serialization.Serializable

@Serializable
data class ToolReceipt(
    val invocationId: ToolInvocationId,
    val toolName: String,
    val exitCode: Int,
    val outputSummary: String,
    @Serializable(with = AnyMapSerializer::class)
    val structuredOutput: Map<String, Any> = emptyMap(),
    val affectedEntities: List<String> = emptyList(),
    val durationMs: Long,
    val tier: Tier,
    val timestamp: Instant,
    val diff: String? = null,
)
