// SPEC-597-EXEMPT: canonical mapping (npm-package↔framework, keyword catalogue)
// — must enumerate framework names by design; no detection logic to migrate.
// tools/suggest-tooling/framework-catalog.ts — Desktop and AI agent tooling line builders
// Extracted from suggest-tooling.ts to stay within the 400-line file budget.
// === SPEC-016a: AI agent tooling ===
export function buildAgentToolingLines(knowledge) {
    const stack = knowledge.stack.map((s) => s.toLowerCase());
    const agentSignals = [
        '@anthropic-ai/sdk',
        '@mastra/core',
        'langgraph',
        'crewai',
        'autogen',
        'langchain',
        '@ai-sdk/anthropic',
        'vercel ai sdk',
    ];
    const isAgent = agentSignals.some((sig) => stack.some((s) => s.includes(sig)));
    if (!isAgent) {
        return [];
    }
    return [
        '## AI Agent Tooling',
        '',
        '### Vector Databases (for RAG and memory)',
        '- **Pinecone** — Managed vector DB, production-ready, serverless (`npm install @pinecone-database/pinecone`)',
        '- **Chroma** — Open-source, local dev friendly (`pip install chromadb`)',
        '- **Weaviate** — Open-source, GraphQL API, multi-modal (`npm install weaviate-client`)',
        '- **Qdrant** — Rust-based, high performance (`npm install @qdrant/js-client-rest`)',
        '',
        '### Memory Solutions',
        '- **mem0** — AI memory layer, supports user/session/agent memory (`npm install mem0ai`)',
        '- **LangChain Memory** — Conversation buffer, summary, entity memory (`pip install langchain`)',
        '',
        '### Agent Orchestration Frameworks',
        '- **LangGraph** — Graph-based stateful agent workflows (`pip install langgraph`)',
        '- **CrewAI** — Role-based multi-agent teams (`pip install crewai`)',
        '- **Mastra** — TypeScript-first agent framework (`npm install @mastra/core`)',
        '- **AutoGen** — Multi-agent conversation framework (`pip install autogen-agentchat`)',
        '',
        '### Evaluation Frameworks',
        '- **RAGAS** — RAG evaluation: faithfulness, answer relevancy, context precision',
        '  - `pip install ragas` — integrate with LangChain or LlamaIndex',
        '- **TruLens** — LLM app evaluation and monitoring (`pip install trulens-eval`)',
        '- **DeepEval** — Unit testing for LLM outputs (`pip install deepeval`)',
        '- **Promptfoo** — LLM evaluation and red-teaming (`npm install -g promptfoo`)',
        '',
        '### Monitoring and Observability',
        '- **LangSmith** — LangChain tracing and evaluation (cloud, `LANGCHAIN_TRACING_V2=true`)',
        '- **Langfuse** — Open-source LLM observability (`npm install langfuse`)',
        '- **Helicone** — LLM proxy with logging (`npm install helicone`)',
        '',
        '### Security',
        '- **LLM Guard** — Input/output sanitization for LLMs (`pip install llm-guard`)',
        '- **Prompt injection detection** — Build regex-based filters for common injection patterns',
        '- **Rate limiting** — Implement per-user token budgets to prevent cost abuse',
        '',
    ];
}
// === SPEC-014b: Desktop distribution tooling ===
export function buildDesktopToolingLines(knowledge) {
    const framework = knowledge.framework?.toLowerCase() ?? '';
    const stack = knowledge.stack.map((s) => s.toLowerCase());
    const isDesktop = knowledge.projectCategory === 'desktop';
    if (!isDesktop) {
        return [];
    }
    const lines = ['## Desktop Distribution Tooling', ''];
    const isElectron = framework === 'electron' || stack.some((s) => s.includes('electron'));
    const isTauri = framework === 'tauri' || stack.some((s) => s.includes('tauri'));
    const isDotNet = framework === 'dotnet' || stack.some((s) => s.includes('dotnet') || s.includes('.net'));
    const isLinuxNative = stack.some((s) => s.includes('gtk') || s.includes('qt') || s.includes('gnome'));
    if (isElectron) {
        lines.push('### Electron Distribution');
        lines.push('');
        lines.push('- **electron-builder** — Recommended packager. Targets:');
        lines.push('  - Windows: `nsis` (full installer), `squirrel` (auto-update friendly)');
        lines.push('  - macOS: `dmg` (drag-to-install), `pkg` (mass deployment)');
        lines.push('  - Linux: `AppImage` (universal), `deb` (Debian/Ubuntu), `snap` (Ubuntu Store)');
        lines.push('- **electron-forge** — Alternative packager with plugin ecosystem');
        lines.push('- **Code Signing Requirements:**');
        lines.push('  - Windows: Authenticode EV certificate (eliminates SmartScreen warning)');
        lines.push('  - macOS: Developer ID Application certificate + notarization (mandatory for Gatekeeper)');
        lines.push('  - Linux: SHA256 checksums (no OS-enforced signing)');
        lines.push('- **electron-updater** — Auto-update via GitHub Releases, S3, or custom server');
        lines.push('');
    }
    if (isTauri) {
        lines.push('### Tauri Distribution');
        lines.push('');
        lines.push('- **Tauri bundler** (built-in) — Native OS installers per platform:');
        lines.push('  - Windows: `msi` (MSI) or `nsis` (NSIS installer)');
        lines.push('  - macOS: `dmg` with mandatory notarization for outside Mac App Store distribution');
        lines.push('  - Linux: `AppImage`, `deb`, `rpm`');
        lines.push('- **macOS Notarization**: required for Gatekeeper (`xcrun notarytool submit`)');
        lines.push('- **Tauri Updater**: configure in `tauri.conf.json` → `tauri.updater`');
        lines.push('  - Provide signed `update.json` endpoint with version + download URLs + signature');
        lines.push('  - Supports differential/patch updates via `tauri-update`');
        lines.push('');
    }
    if (isDotNet && !isElectron && !isTauri) {
        lines.push('### .NET Desktop Distribution');
        lines.push('');
        lines.push('- **ClickOnce** — Intranet/enterprise deployment (self-updating, no admin required)');
        lines.push('  - Best for: internal tools, .NET Framework WPF/WinForms apps');
        lines.push('  - Requires: code signing cert, IIS/file share hosting');
        lines.push('- **MSIX** — Microsoft Store + enterprise sideloading');
        lines.push('  - Best for: Store distribution or MDM/Intune enterprise deployment');
        lines.push('  - Requires: Partner Center account (Store) or EV cert (sideload)');
        lines.push('- **WiX Toolset** — Custom MSI installer (most flexible, steeper learning curve)');
        lines.push('  - Best for: complex install requirements (registry, services, custom actions)');
        lines.push('- **.NET Framework vs .NET 6+:**');
        lines.push('  - .NET Framework: Windows-only, ClickOnce supported out-of-box');
        lines.push('  - .NET 6+: cross-platform (win-x64, osx-x64, linux-x64), self-contained publish');
        lines.push('');
    }
    if (isLinuxNative) {
        lines.push('### Linux Native Distribution');
        lines.push('');
        lines.push('- **Flatpak** — Recommended for Flathub (broadest distro coverage)');
        lines.push('  - Sandboxed (limited filesystem/portal access via `xdg-portal`)');
        lines.push('  - Manifest: `org.example.App.yml` + `org.freedesktop.Platform` runtime');
        lines.push('  - Submit to Flathub: `https://github.com/flathub/flathub`');
        lines.push('- **Snap** — Ubuntu Snap Store (Canonical ecosystem)');
        lines.push('  - Config: `snapcraft.yaml` with confinement: strict/classic');
        lines.push('  - Classic confinement = full filesystem access (like deb, review required)');
        lines.push('- **deb** — Debian/Ubuntu direct packaging (no sandbox, full OS access)');
        lines.push('  - Use `dpkg-deb` or `fpm` for building');
        lines.push('  - Host on PPA (Ubuntu) or custom apt repository');
        lines.push('- **rpm** — Fedora/RHEL/openSUSE packaging (no sandbox, full OS access)');
        lines.push('  - Use `rpmbuild` or `fpm` for building');
        lines.push('  - Host on COPR (Fedora) or custom RPM repository');
        lines.push('- **Sandbox vs no-sandbox**: Flatpak apps must request permissions via portals;');
        lines.push('  deb/rpm apps have unrestricted access but require user trust.');
        lines.push('');
    }
    return lines;
}
//# sourceMappingURL=framework-catalog.js.map