
import { localize } from '../../../../../nls.js';
import { Target } from './promptTypes.js';

var HookType;
(function(HookType) {
    HookType["SessionStart"] = "SessionStart";
    HookType["SessionEnd"] = "SessionEnd";
    HookType["UserPromptSubmit"] = "UserPromptSubmit";
    HookType["PreToolUse"] = "PreToolUse";
    HookType["PostToolUse"] = "PostToolUse";
    HookType["PreCompact"] = "PreCompact";
    HookType["SubagentStart"] = "SubagentStart";
    HookType["SubagentStop"] = "SubagentStop";
    HookType["Stop"] = "Stop";
    HookType["ErrorOccurred"] = "ErrorOccurred";
})(HookType || (HookType = {}));
const HOOKS_BY_TARGET = {
    [Target.VSCode]: {
        "SessionStart": HookType.SessionStart,
        "UserPromptSubmit": HookType.UserPromptSubmit,
        "PreToolUse": HookType.PreToolUse,
        "PostToolUse": HookType.PostToolUse,
        "PreCompact": HookType.PreCompact,
        "SubagentStart": HookType.SubagentStart,
        "SubagentStop": HookType.SubagentStop,
        "Stop": HookType.Stop
    },
    [Target.GitHubCopilot]: {
        "sessionStart": HookType.SessionStart,
        "sessionEnd": HookType.SessionEnd,
        "userPromptSubmitted": HookType.UserPromptSubmit,
        "preToolUse": HookType.PreToolUse,
        "postToolUse": HookType.PostToolUse,
        "agentStop": HookType.Stop,
        "subagentStop": HookType.SubagentStop,
        "errorOccurred": HookType.ErrorOccurred
    },
    [Target.Claude]: {
        "SessionStart": HookType.SessionStart,
        "UserPromptSubmit": HookType.UserPromptSubmit,
        "PreToolUse": HookType.PreToolUse,
        "PostToolUse": HookType.PostToolUse,
        "PreCompact": HookType.PreCompact,
        "SubagentStart": HookType.SubagentStart,
        "SubagentStop": HookType.SubagentStop,
        "Stop": HookType.Stop
    },
    [Target.Undefined]: Object.fromEntries(( ( Object.values(HookType)).map(h => [h, h])))
};
const HOOK_METADATA = {
    [HookType.SessionStart]: {
        label: ( localize(8046, "Session Start")),
        description: ( localize(8047, "Executed when a new agent session begins."))
    },
    [HookType.UserPromptSubmit]: {
        label: ( localize(8048, "User Prompt Submit")),
        description: ( localize(8049, "Executed when the user submits a prompt to the agent."))
    },
    [HookType.PreToolUse]: {
        label: ( localize(8050, "Pre-Tool Use")),
        description: ( localize(8051, "Executed before the agent uses any tool."))
    },
    [HookType.PostToolUse]: {
        label: ( localize(8052, "Post-Tool Use")),
        description: ( localize(8053, "Executed after a tool completes execution successfully."))
    },
    [HookType.PreCompact]: {
        label: ( localize(8054, "Pre-Compact")),
        description: ( localize(8055, "Executed before the agent compacts the conversation context."))
    },
    [HookType.SubagentStart]: {
        label: ( localize(8056, "Subagent Start")),
        description: ( localize(8057, "Executed when a subagent is started."))
    },
    [HookType.SubagentStop]: {
        label: ( localize(8058, "Subagent Stop")),
        description: ( localize(8059, "Executed when a subagent stops."))
    },
    [HookType.Stop]: {
        label: ( localize(8060, "Stop")),
        description: ( localize(8061, "Executed when the agent stops."))
    },
    [HookType.SessionEnd]: {
        label: ( localize(8062, "Session End")),
        description: ( localize(8063, "Executed when an agent session ends."))
    },
    [HookType.ErrorOccurred]: {
        label: ( localize(8064, "Error Occurred")),
        description: ( localize(8065, "Executed when an error occurs during the agent session."))
    }
};

export { HOOKS_BY_TARGET, HOOK_METADATA, HookType };
