"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AUTOMATION_PROTOCOL_FEATURES = exports.AUTOMATION_PROTOCOL_VERSIONS = exports.MAXIMUM_SUPPORTED_AUTOMATION_PROTOCOL_VERSION = exports.MINIMUM_SUPPORTED_AUTOMATION_PROTOCOL_VERSION = exports.AUTOMATION_PROTOCOL_VERSION = void 0;
exports.getAutomationProtocolFeatureManifest = getAutomationProtocolFeatureManifest;
exports.resolveAutomationProtocolVersion = resolveAutomationProtocolVersion;
exports.selectAutomationProtocolVersion = selectAutomationProtocolVersion;
exports.getSelectedAutomationProtocolVersion = getSelectedAutomationProtocolVersion;
exports.getAutomationProtocolEnvelopeSchemaRef = getAutomationProtocolEnvelopeSchemaRef;
exports.AUTOMATION_PROTOCOL_VERSION = 2;
exports.MINIMUM_SUPPORTED_AUTOMATION_PROTOCOL_VERSION = 1;
exports.MAXIMUM_SUPPORTED_AUTOMATION_PROTOCOL_VERSION = 2;
exports.AUTOMATION_PROTOCOL_VERSIONS = [1, 2];
exports.AUTOMATION_PROTOCOL_FEATURES = [
    "detail-grouping-filter-controls",
    "default-compact-json",
    "full-detail-json-envelopes",
    "output-budgets",
    "pagination",
    "protocol-feature-discovery",
    "typed-terminal-failures",
    "workflow-actions"
];
const FEATURE_MANIFEST = Object.freeze({
    currentVersion: exports.AUTOMATION_PROTOCOL_VERSION,
    minimumSupportedVersion: exports.MINIMUM_SUPPORTED_AUTOMATION_PROTOCOL_VERSION,
    maximumSupportedVersion: exports.MAXIMUM_SUPPORTED_AUTOMATION_PROTOCOL_VERSION,
    features: Object.freeze([...exports.AUTOMATION_PROTOCOL_FEATURES]),
    deprecations: Object.freeze([])
});
function getAutomationProtocolFeatureManifest() {
    return FEATURE_MANIFEST;
}
let selectedProtocolVersion = exports.AUTOMATION_PROTOCOL_VERSION;
function resolveAutomationProtocolVersion(value) {
    const normalized = typeof value === "string" && /^\d+$/u.test(value) ? Number(value) : value;
    return normalized === 1 || normalized === 2 ? normalized : null;
}
function selectAutomationProtocolVersion(version) {
    selectedProtocolVersion = version;
}
function getSelectedAutomationProtocolVersion() {
    return selectedProtocolVersion;
}
function getAutomationProtocolEnvelopeSchemaRef(version = getSelectedAutomationProtocolVersion()) {
    return `schemas/automation/v${version}/envelope.schema.json`;
}
