local addonName, SinsToolkit = ...

local DevTools = SinsToolkit.DevTools
if not DevTools then return end

DevTools:RegisterTool("frame-inspector", {
    name = "Frame Inspector",
    description = "Start a lightweight hover inspector, copy the current frame report, or open Blizzard's built-in /fstack.",
    status = "available",
    slashCommand = "/stk",
    page = "Frame Inspector",
    open = function()
        if SinsToolkit.Window and SinsToolkit.Window.SelectPage then
            SinsToolkit.Window:SelectPage("Frame Inspector")
        end
    end,
})

DevTools:RegisterTool("identifier", {
    name = "Identifier",
    description = "Inspect the UI frame under your cursor, copy frame details, or look up a global frame by name.",
    status = "available",
    slashCommand = "/stkid",
    page = "Identifier",
    open = function()
        if SinsToolkit.Window and SinsToolkit.Window.SelectPage then
            SinsToolkit.Window:SelectPage("Identifier")
        end
    end,
})

DevTools:RegisterTool("bug-catcher", {
    name = "Bug Catcher",
    description = "Review captured Lua errors, Lua warnings, protected-action messages, and safe self-test entries.",
    status = "available",
    slashCommand = "/stkbug",
    page = "Bug Catcher",
    open = function()
        if SinsToolkit.BugCatcher and SinsToolkit.BugCatcher.ShowLast then
            SinsToolkit.BugCatcher:ShowLast()
        elseif SinsToolkit.Window and SinsToolkit.Window.SelectPage then
            SinsToolkit.Window:SelectPage("Bug Catcher")
        end
    end,
})

DevTools:RegisterTool("cvars", {
    name = "CVar Browser",
    description = "Browse live client CVars, compare current and default values, filter modified entries, and reset supported values.",
    status = "available",
    slashCommand = "/stk",
    page = "CVars",
    open = function()
        if SinsToolkit.Window and SinsToolkit.Window.SelectPage then
            SinsToolkit.Window:SelectPage("CVars")
        end
    end,
})

DevTools:RegisterTool("frame-tools", {
    name = "Frame Tools",
    description = "Configure supported Blizzard frame movement, scaling, position saving, scale saving, and reset behavior.",
    status = "available",
    slashCommand = "/stk",
    page = "Frame Tools",
    open = function()
        if SinsToolkit.Window and SinsToolkit.Window.SelectPage then
            SinsToolkit.Window:SelectPage("Frame Tools")
        end
    end,
})
