package com.correx.core.tools.contract

import kotlinx.serialization.Serializable

/**
 * What a tool is allowed to do, independent of its name. Plane-2 (`core:toolintent`) rules dispatch
 * on these — never on tool names — and they are recorded on
 * [com.correx.core.events.events.ToolInvocationRequestedEvent] at emission, so replay classifies a
 * call by the capability it actually had rather than re-deriving it from the live registry.
 *
 * Lives in `core:events` (the lowest module) so events can carry it; `core:tools` and everything
 * above import it from here — the package name is unchanged, so the move is import-transparent.
 */
@Serializable
enum class ToolCapability {
    FILE_READ,

    /**
     * Enumerates a directory rather than reading a file's contents. Carried alongside [FILE_READ]
     * (a listing is a read-only operation) but tagged distinctly so anti-hallucination read gates
     * can exempt it: listing a not-yet-created directory is a legitimate survey move (it truthfully
     * reports "absent/empty"), not a hallucinated read that must be blocked.
     */
    DIRECTORY_LIST,
    FILE_WRITE,
    NETWORK_ACCESS,
    SHELL_EXEC,
    PROCESS_SPAWN,
}
