"use strict";
// vibe-context.ts — Vibe injection into @cell context
// Reads .cell/vibe/vibe-summary.json and formats for AI consumption
Object.defineProperty(exports, "__esModule", { value: true });
exports.getVibeForContext = getVibeForContext;
const vibe_engine_1 = require("./vibe-engine");
const VIBE_DIR_RELATIVE = '.cell/vibe';
function getVibeForContext(projectDir) {
    const dir = projectDir || process.cwd();
    const summary = (0, vibe_engine_1.getVibeSummary)(dir);
    if (!summary || summary.totalRules === 0)
        return null;
    return {
        type: 'vibe',
        reason: 'developer personality and working style',
        data: formatVibeBlock(summary),
        importance: 90,
    };
}
function formatVibeBlock(summary) {
    const lines = [];
    lines.push('━━━ YOUR VIBE ━━━');
    // One-line summary
    lines.push(`  ${summary.summary}`);
    lines.push('');
    // Coding section
    if (Object.keys(summary.coding).length > 0) {
        const parts = [];
        if (summary.coding.changeSize)
            parts.push(`Changes: ${summary.coding.changeSize}`);
        if (summary.coding.abstraction)
            parts.push(`Abstraction: ${summary.coding.abstraction}`);
        if (summary.coding.testing)
            parts.push(`Testing: ${summary.coding.testing}`);
        if (summary.coding.typescript)
            parts.push(`TS: ${summary.coding.typescript}`);
        if (parts.length > 0)
            lines.push(`  CODE: ${parts.join(' | ')}`);
    }
    // Communication
    if (Object.keys(summary.communication).length > 0) {
        const parts = [];
        if (summary.communication.language)
            parts.push(summary.communication.language);
        if (summary.communication.structure)
            parts.push(summary.communication.structure);
        if (summary.communication.tone)
            parts.push(summary.communication.tone);
        if (summary.communication.verbosity)
            parts.push(summary.communication.verbosity);
        if (parts.length > 0)
            lines.push(`  COMMUNICATION: ${parts.join(', ')}`);
    }
    // Decision driver
    if (summary.decisionDriver && summary.decisionDriver !== 'balanced') {
        lines.push(`  DECISIONS: ${summary.decisionDriver}-first`);
    }
    // Ship style
    if (summary.shipStyle && summary.shipStyle !== 'balanced') {
        lines.push(`  SHIPPING: ${summary.shipStyle}`);
    }
    // AI trust
    if (summary.aiTrust && summary.aiTrust !== 'balanced') {
        lines.push(`  AI TRUST: ${summary.aiTrust}`);
    }
    // Risk profile
    if (summary.riskProfile) {
        lines.push(`  RISK: ${summary.riskProfile} tolerance`);
    }
    // Best workflow
    if (summary.bestWorkflow && summary.bestWorkflow !== 'Standard workflow') {
        lines.push(`  WORKFLOW: ${summary.bestWorkflow}`);
    }
    // Strengths
    if (summary.strengths.length > 0 && summary.strengths[0] !== 'Still discovering strengths') {
        lines.push(`\n  STRENGTHS: ${summary.strengths.join(' | ')}`);
    }
    // Risks
    if (summary.risks.length > 0 && summary.risks[0] !== 'No risks detected yet') {
        lines.push(`  RISKS: ${summary.risks.join(' | ')}`);
    }
    // Avoid
    if (summary.avoid.length > 0 && summary.avoid[0] !== 'Nothing specific yet') {
        lines.push(`  AVOID: ${summary.avoid.join(', ')}`);
    }
    return lines.join('\n');
}
//# sourceMappingURL=vibe-context.js.map