package com.correx.core.events.events

import com.correx.core.events.serialization.AnyMapSerializer
import com.correx.core.events.types.SessionId
import com.correx.core.events.types.StageId
import com.correx.core.events.types.ToolInvocationId
import kotlinx.serialization.Serializable

@Serializable
data class ToolRequest(
    val invocationId: ToolInvocationId,
    val sessionId: SessionId,
    val stageId: StageId,
    val toolName: String,
    @Serializable(with = AnyMapSerializer::class)
    val parameters: Map<String, Any> = emptyMap(),
    // Paths outside the workspace root that the operator has approved for this call (recorded via
    // OutsidePathAccessGrantedEvent). Read tools widen their containment jail to admit these; write
    // tools ignore them, so writes stay workspace-jailed. Empty by default = pure workspace jail.
    val grantedPaths: Set<String> = emptySet(),
)
