package link.socket.ampere.agents.execution.tools

import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertIs
import kotlin.test.assertTrue
import link.socket.ampere.agents.config.AgentActionAutonomy

class ToolCreateIssuesTest {

    @Test
    fun `ToolCreateIssues factory creates tool with correct metadata`() {
        val tool = ToolCreateIssues()

        assertEquals("create_issues", tool.id)
        assertEquals("Create Issues", tool.name)
        assertEquals(AgentActionAutonomy.ACT_WITH_NOTIFICATION, tool.requiredAgentAutonomy)
        assertTrue(tool.description.contains("hierarchical"))
        assertTrue(tool.description.contains("dependency"))
    }

    @Test
    fun `ToolCreateIssues factory accepts custom autonomy level`() {
        val tool = ToolCreateIssues(
            requiredAgentAutonomy = AgentActionAutonomy.ASK_BEFORE_ACTION,
        )

        assertEquals(AgentActionAutonomy.ASK_BEFORE_ACTION, tool.requiredAgentAutonomy)
    }

    @Test
    fun `ToolCreateIssues is a FunctionTool`() {
        val tool = ToolCreateIssues()

        assertIs<FunctionTool<*>>(tool)
    }
}
