// tools/suggest-tooling/ai-native-catalog.ts — SPEC-056
// Builds AI-native architecture tooling recommendation lines for suggest_tooling.
// Covers: LLM observability, semantic cache, prompt management, guardrails.
/**
 * Build AI-native tooling recommendation lines.
 * Emits recommendations for observability, caching, prompt management and guardrails
 * when the project has AI-native or AI-bolted-on detection.
 */
export function buildAiNativeToolingLines(knowledge) {
    const detection = knowledge.aiNativeDetection;
    if (!detection) {
        return [];
    }
    if (!detection.isAiNative && !detection.isAiBoltedOn) {
        return [];
    }
    const lines = ['', '## AI-Native Architecture Tooling', ''];
    const classification = detection.isAiNative ? 'AI-native' : 'AI-bolted-on';
    lines.push(`**Clasificacion:** ${classification} (${String(detection.aiDeps.length)} AI deps detectadas)`);
    if (detection.inferenceMode !== 'none') {
        lines.push(`**Modo de inferencia:** ${detection.inferenceMode}`);
    }
    if (detection.frameworks.length > 0) {
        lines.push(`**Frameworks de orquestacion:** ${detection.frameworks.join(', ')}`);
    }
    lines.push('');
    // S9: Observability
    lines.push(...buildObservabilitySection(detection.isAiNative));
    // S10: Semantic cache
    if (detection.isAiNative) {
        lines.push(...buildSemanticCacheSection());
    }
    // S11: Prompt management
    lines.push(...buildPromptManagementSection(detection.isAiNative));
    // S12: Guardrails
    lines.push(...buildGuardrailsSection(detection.isAiNative));
    return lines;
}
function buildObservabilitySection(isNative) {
    const priority = isNative ? '**(required)**' : '(recommended)';
    return [
        '### LLM Observability',
        '',
        `**Langfuse** ${priority} — Open-source LLM observability and analytics`,
        '- Self-hosteable, tracing de prompts, metricas de costo/latencia',
        '- Docs: https://langfuse.com/docs',
        '',
        `**LangSmith** ${priority} — LangChain native observability platform`,
        '- Tracing, evaluation, prompt playground integrado',
        '- Docs: https://docs.smith.langchain.com',
        '',
        '**Arize Phoenix** — Open-source LLM observability with embeddings analysis',
        '- Visualizacion de embeddings, deteccion de drift, experiment tracking',
        '- Docs: https://docs.arize.com/phoenix',
        '',
    ];
}
function buildSemanticCacheSection() {
    return [
        '### Semantic Cache',
        '',
        '**GPTCache** — Semantic caching for LLM responses',
        '- Reduce latencia y costos cacheando respuestas semanticamente similares',
        '- Docs: https://gptcache.readthedocs.io',
        '',
        '**Redis Semantic Cache** — Redis-based semantic similarity caching',
        '- Integrable con Redis Stack y vectores de embedding',
        '- Docs: https://redis.io/docs/latest/develop/interact/search-and-query/query/vector-search/',
        '',
    ];
}
function buildPromptManagementSection(isNative) {
    const priority = isNative ? '**(required)**' : '(recommended)';
    return [
        '### Prompt Management',
        '',
        `**Langfuse Prompt Management** ${priority} — Version control for prompts`,
        '- Versionado semantico de prompts, A/B testing, rollback',
        '- Docs: https://langfuse.com/docs/prompts',
        '',
        '**PromptLayer** — Prompt versioning and monitoring',
        '- Historico de prompts, metricas de performance por version',
        '- Docs: https://docs.promptlayer.com',
        '',
        '**Helicone** — LLM proxy with prompt analytics',
        '- Request logging, cost tracking, rate limiting integrado',
        '- Docs: https://docs.helicone.ai',
        '',
    ];
}
function buildGuardrailsSection(isNative) {
    const priority = isNative ? '**(required)**' : '(recommended)';
    return [
        '### AI Guardrails',
        '',
        `**Guardrails AI** ${priority} — Output validation framework for LLMs`,
        '- Validacion de output contra schema, PII detection, content moderation',
        '- Docs: https://docs.guardrailsai.com',
        '',
        `**NeMo Guardrails** ${priority} — NVIDIA programmable guardrails`,
        '- Politicas declarativas en Colang, topical control, safety filtering',
        '- Docs: https://docs.nvidia.com/nemo/guardrails/',
        '',
        '**llm-guard** — Input/output security scanner for LLMs',
        '- Prompt injection detection, PII redaction, toxicity filtering',
        '- Docs: https://llm-guard.com',
        '',
    ];
}
//# sourceMappingURL=ai-native-catalog.js.map