"use strict";
/**
 * Image Analyzer Hook Configuration
 *
 * Manages hook configuration for image analysis in Claude settings.
 *
 * @module utils/hooks/image-analyzer-hook-config
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getImageAnalyzerHookConfig = exports.getImageAnalyzerHookPath = void 0;
const path = __importStar(require("path"));
const config_manager_1 = require("../config-manager");
const config_loader_facade_1 = require("../../config/config-loader-facade");
// Hook file name
const IMAGE_ANALYZER_HOOK = 'image-analyzer-transformer.cjs';
/**
 * Get path to image analyzer hook
 */
function getImageAnalyzerHookPath() {
    return path.join((0, config_manager_1.getCcsHooksDir)(), IMAGE_ANALYZER_HOOK);
}
exports.getImageAnalyzerHookPath = getImageAnalyzerHookPath;
/**
 * Get hook config for settings.json injection
 * Timeout includes buffer for CLI overhead
 */
function getImageAnalyzerHookConfig() {
    const hookPath = getImageAnalyzerHookPath();
    const imageConfig = (0, config_loader_facade_1.getImageAnalysisConfig)();
    // Add 5 second buffer to analysis timeout for hook execution overhead
    const hookTimeout = imageConfig.timeout * 1000 + 5000;
    return {
        PreToolUse: [
            {
                matcher: 'Read',
                hooks: [
                    {
                        type: 'command',
                        command: `node "${hookPath}"`,
                        timeout: hookTimeout,
                    },
                ],
            },
        ],
    };
}
exports.getImageAnalyzerHookConfig = getImageAnalyzerHookConfig;
//# sourceMappingURL=image-analyzer-hook-configuration.js.map