package com.correx.core.tools.contract

import com.correx.core.approvals.Tier
import com.correx.core.events.events.ToolRequest
import com.correx.core.tools.compression.IdentityCompressor
import com.correx.core.tools.compression.ToolOutputCompressor
import kotlinx.serialization.json.JsonObject

interface Tool {
    val name: String
    val description: String
    val parametersSchema: JsonObject
    val tier: Tier
    val requiredCapabilities: Set<ToolCapability>
    val paramRoles: Map<String, ParamRole> get() = emptyMap()

    /**
     * How this tool's raw output is compressed before it enters the context pack.
     * Applied on the derivation path only; raw output stays authoritative in the
     * event log (invariant #6). Defaults to no-op.
     */
    val outputCompressor: ToolOutputCompressor get() = IdentityCompressor
    fun validateRequest(request: ToolRequest): ValidationResult
}
