const TOOL_ALIAS_MAP = {
    ask_user: 'ask-user',
    askuserquestion: 'ask-user',
    bash: 'shell',
    edit: 'edit-workspace',
    contentsearch: 'content-search',
    exec: 'shell',
    glob: 'workspace-search',
    grep: 'content-search',
    read: 'read-file',
    websearch: 'web-search',
    webfetch: 'fetch-url',
    write: 'write-workspace',
};
function normalizeText(value) {
    return String(value ?? '').trim().toLowerCase();
}
export function canonicalToolName(rawName) {
    const normalized = normalizeText(rawName);
    if (!normalized)
        return '';
    return TOOL_ALIAS_MAP[normalized] ?? normalized;
}
export function toolSemantic(rawName) {
    switch (canonicalToolName(rawName)) {
        case 'ask-user':
            return 'ask_user';
        case 'delegate_tasks':
            return 'delegate';
        case 'edit-workspace':
        case 'multiedit-workspace':
            return 'edit_like';
        case 'shell':
            return 'exec_like';
        case 'fetch-url':
            return 'fetch_like';
        case 'read-file':
        case 'read-file-range':
            return 'read_like';
        case 'content-search':
        case 'workspace-search':
        case 'web-search':
            return 'search_like';
        case 'write-artifact':
        case 'write-scratch':
        case 'write-workspace':
        case 'write-workspace-batch':
            return 'write_like';
        default:
            return 'other';
    }
}
export function toolDisplayLabel(rawName) {
    return canonicalToolName(rawName);
}
export function isAskUserToolName(rawName) {
    return toolSemantic(rawName) === 'ask_user';
}
export function isDelegateToolName(rawName) {
    return toolSemantic(rawName) === 'delegate';
}
export function isEditLikeToolName(rawName) {
    return toolSemantic(rawName) === 'edit_like';
}
export function isExecLikeToolName(rawName) {
    return toolSemantic(rawName) === 'exec_like';
}
export function isFetchLikeToolName(rawName) {
    return toolSemantic(rawName) === 'fetch_like';
}
export function isReadLikeToolName(rawName) {
    return toolSemantic(rawName) === 'read_like';
}
export function isSearchLikeToolName(rawName) {
    return toolSemantic(rawName) === 'search_like';
}
export function isWriteLikeToolName(rawName) {
    return toolSemantic(rawName) === 'write_like';
}
//# sourceMappingURL=tool-metadata.js.map