"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.followUpToolsSchema = exports.legacyFollowUpToolsTransform = exports.legacyToNewMapping = exports.LegacyFollowUpTools = exports.followUpToolsText = exports.isActiveFollowUpTool = exports.activeFollowUpTools = void 0;
const zod_1 = require("zod");
const types_1 = require("./types");
exports.activeFollowUpTools = Object.values(types_1.AiResultType).filter((tool) => tool !== types_1.AiResultType.PROPOSE_CHANGE);
const isActiveFollowUpTool = (value) => exports.activeFollowUpTools.some((tool) => tool === value);
exports.isActiveFollowUpTool = isActiveFollowUpTool;
exports.followUpToolsText = {
    [types_1.AiResultType.TABLE_RESULT]: 'Generate a Table',
    [types_1.AiResultType.VERTICAL_BAR_RESULT]: 'Generate a Bar Chart',
    [types_1.AiResultType.TIME_SERIES_RESULT]: 'Generate a Time Series Chart',
    [types_1.AiResultType.QUERY_RESULT]: 'Run Query',
    [types_1.AiResultType.DASHBOARD_RESULT]: 'Generate a Dashboard',
    [types_1.AiResultType.DASHBOARD_V2_RESULT]: 'Generate a Dashboard (v2)',
    [types_1.AiResultType.IMPROVE_CONTEXT]: 'Improve Context',
    [types_1.AiResultType.PROPOSE_CHANGE]: 'Propose a Change',
};
var LegacyFollowUpTools;
(function (LegacyFollowUpTools) {
    LegacyFollowUpTools["GENERATE_TABLE"] = "generate_table";
    LegacyFollowUpTools["GENERATE_BAR_VIZ"] = "generate_bar_viz";
    LegacyFollowUpTools["GENERATE_TIME_SERIES_VIZ"] = "generate_time_series_viz";
})(LegacyFollowUpTools || (exports.LegacyFollowUpTools = LegacyFollowUpTools = {}));
exports.legacyToNewMapping = {
    [LegacyFollowUpTools.GENERATE_TABLE]: types_1.AiResultType.TABLE_RESULT,
    [LegacyFollowUpTools.GENERATE_BAR_VIZ]: types_1.AiResultType.VERTICAL_BAR_RESULT,
    [LegacyFollowUpTools.GENERATE_TIME_SERIES_VIZ]: types_1.AiResultType.TIME_SERIES_RESULT,
};
const legacyFollowUpToolsTransform = (tools) => tools.map((tool) => {
    if (tool in exports.legacyToNewMapping) {
        return exports.legacyToNewMapping[tool];
    }
    return tool;
});
exports.legacyFollowUpToolsTransform = legacyFollowUpToolsTransform;
// this is used only for slack at the moment, so no backwards compatibility is needed
// TODO :: reuse this schema across the tools
exports.followUpToolsSchema = zod_1.z.nativeEnum(types_1.AiResultType).array();
//# sourceMappingURL=followUpTools.js.map