"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PROTOCOL_FRAMEWORK_MATRIX = exports.ProtocolModeSchema = exports.NetworkModeSchema = exports.DEFAULT_RUNTIME_BY_LANGUAGE = exports.DEFAULT_ENTRYPOINT_BY_LANGUAGE = exports.RuntimeVersionSchema = exports.DEFAULT_NODE_VERSION = exports.NodeRuntimeSchema = exports.DEFAULT_PYTHON_VERSION = exports.PythonRuntimeSchema = exports.RESERVED_PROJECT_NAMES = exports.SDK_MODEL_PROVIDER_MATRIX = exports.DEFAULT_MODEL_IDS = exports.CREDENTIAL_PROVIDERS = exports.ModelProviderSchema = exports.TargetLanguageSchema = exports.SDKFrameworkSchema = void 0;
exports.matchEnumValue = matchEnumValue;
exports.getSupportedModelProviders = getSupportedModelProviders;
exports.isModelProviderSupported = isModelProviderSupported;
exports.isReservedProjectName = isReservedProjectName;
exports.getSupportedFrameworksForProtocol = getSupportedFrameworksForProtocol;
exports.isFrameworkSupportedForProtocol = isFrameworkSupportedForProtocol;
const zod_1 = require("zod");
// ============================================================================
// Feature Constants (shared across all schemas)
// ============================================================================
exports.SDKFrameworkSchema = zod_1.z.enum(['Strands', 'LangChain_LangGraph', 'GoogleADK', 'OpenAIAgents', 'VercelAI']);
exports.TargetLanguageSchema = zod_1.z.enum(['Python', 'TypeScript', 'Other']);
exports.ModelProviderSchema = zod_1.z.enum(['Bedrock', 'Gemini', 'OpenAI', 'Anthropic']);
/** Providers that use credentials (Bedrock uses IAM, no credential needed). */
exports.CREDENTIAL_PROVIDERS = ['Gemini', 'OpenAI', 'Anthropic'];
/**
 * Case-insensitively match a user-provided value against a Zod enum's options.
 * Returns the canonical (correctly-cased) value, or undefined if no match.
 */
function matchEnumValue(schema, input) {
    const lower = input.toLowerCase();
    return schema.options.find(v => v.toLowerCase() === lower);
}
/**
 * Default model IDs used for each provider.
 * These are the models generated in agent templates.
 */
exports.DEFAULT_MODEL_IDS = {
    Bedrock: 'us.anthropic.claude-sonnet-4-5-20250514-v1:0',
    Anthropic: 'claude-sonnet-4-5-20250514',
    OpenAI: 'gpt-4.1',
    Gemini: 'gemini-2.5-flash',
};
/**
 * Matrix defining which model providers are supported for each SDK framework.
 * - Most SDKs support all 4 providers (Bedrock, Anthropic, OpenAI, Gemini)
 * - GoogleADK only supports Gemini (uses Google's native API)
 * - OpenAIAgents only supports OpenAI (uses OpenAI's native API)
 */
exports.SDK_MODEL_PROVIDER_MATRIX = {
    Strands: ['Bedrock', 'Anthropic', 'OpenAI', 'Gemini'],
    LangChain_LangGraph: ['Bedrock', 'Anthropic', 'OpenAI', 'Gemini'],
    GoogleADK: ['Gemini'],
    OpenAIAgents: ['OpenAI'],
    VercelAI: ['Bedrock', 'Anthropic', 'OpenAI', 'Gemini'],
};
/**
 * Returns the supported model providers for a given SDK framework.
 */
function getSupportedModelProviders(sdk) {
    return exports.SDK_MODEL_PROVIDER_MATRIX[sdk];
}
/**
 * Checks if a model provider is supported for a given SDK framework.
 */
function isModelProviderSupported(sdk, provider) {
    return exports.SDK_MODEL_PROVIDER_MATRIX[sdk].includes(provider);
}
// ============================================================================
// Reserved Project Names (Python package conflicts)
// ============================================================================
/**
 * Project/agent names that would conflict with Python package names when
 * creating a virtual environment. If the project directory name matches
 * a dependency name, uv/pip will fail to resolve dependencies correctly.
 *
 * This list includes all dependencies used across SDK templates, normalized
 * to valid project name format (lowercase, underscores replaced with nothing
 * since project names are alphanumeric only).
 */
exports.RESERVED_PROJECT_NAMES = [
    // Core SDK packages
    'anthropic',
    'autogen',
    'autogenagentchat',
    'autogenext',
    'bedrock',
    'bedrockagentcore',
    'googleadk',
    'googlegenerativeai',
    'langchain',
    'langchainanthropic',
    'langchainaws',
    'langchaingooglegenai',
    'langchainmcpadapters',
    'langchainopenai',
    'langgraph',
    'mcp',
    'openai',
    'openaiagents',
    'strands',
    'strandsagents',
    'strandsagentstools',
    // AG-UI adapter packages
    'agui',
    'aguistrands',
    'aguilanggraph',
    'aguiadk',
    'aguiprotocol',
    'vercelai',
    'aisdk',
    // Common utilities
    'httpx',
    'pytest',
    'pytestasyncio',
    'pythondotenv',
    // Build tools
    'hatchling',
    'setuptools',
    'wheel',
    // AWS packages
    'awsopentelemetrydistro',
    'boto3',
    'botocore',
    // Common Python stdlib/package names that could cause issues
    'test',
    'tests',
    'src',
    'lib',
    'dist',
    'build',
    'env',
    'venv',
    'site',
    'pip',
    'uv',
];
/**
 * Check if a project name is reserved (case-insensitive).
 */
function isReservedProjectName(name) {
    return exports.RESERVED_PROJECT_NAMES.includes(name.toLowerCase());
}
// ============================================================================
// Infrastructure Constants (shared between agent-env and mcp schemas)
// ============================================================================
exports.PythonRuntimeSchema = zod_1.z.enum(['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13', 'PYTHON_3_14']);
/** Default Python runtime version for new agents and MCP tools */
exports.DEFAULT_PYTHON_VERSION = 'PYTHON_3_14';
exports.NodeRuntimeSchema = zod_1.z.enum(['NODE_18', 'NODE_20', 'NODE_22']);
/** Default Node.js runtime version for new TypeScript agents */
exports.DEFAULT_NODE_VERSION = 'NODE_22';
/** Combined runtime version schema supporting both Python and Node/TypeScript runtimes */
exports.RuntimeVersionSchema = zod_1.z.union([exports.PythonRuntimeSchema, exports.NodeRuntimeSchema]);
/** Default entrypoint filename for each target language (create path). */
exports.DEFAULT_ENTRYPOINT_BY_LANGUAGE = {
    Python: 'main.py',
    TypeScript: 'main.js',
};
/** Default runtime version for each target language (create path). */
exports.DEFAULT_RUNTIME_BY_LANGUAGE = {
    Python: exports.DEFAULT_PYTHON_VERSION,
    TypeScript: exports.DEFAULT_NODE_VERSION,
};
exports.NetworkModeSchema = zod_1.z.enum(['PUBLIC', 'VPC']);
// ============================================================================
// Protocol Mode
// ============================================================================
exports.ProtocolModeSchema = zod_1.z.enum(['HTTP', 'MCP', 'A2A', 'AGUI']);
/**
 * Matrix defining which SDK frameworks are supported for each protocol mode.
 * MCP is a standalone tool server with no framework.
 */
exports.PROTOCOL_FRAMEWORK_MATRIX = {
    HTTP: ['Strands', 'LangChain_LangGraph', 'GoogleADK', 'OpenAIAgents', 'VercelAI'],
    MCP: [],
    A2A: ['Strands', 'GoogleADK', 'LangChain_LangGraph'],
    AGUI: ['Strands', 'LangChain_LangGraph', 'GoogleADK'],
};
/**
 * Returns the supported SDK frameworks for a given protocol mode.
 */
function getSupportedFrameworksForProtocol(protocol) {
    return exports.PROTOCOL_FRAMEWORK_MATRIX[protocol];
}
/**
 * Checks if a framework is supported for a given protocol mode.
 */
function isFrameworkSupportedForProtocol(protocol, framework) {
    return exports.PROTOCOL_FRAMEWORK_MATRIX[protocol].includes(framework);
}
//# sourceMappingURL=constants.js.map