const INTENT_RULES = [
    {
        kind: "end",
        confidence: 0.95,
        reason: "explicit continuity finalization request",
        patterns: [
            /\b(?:finaliza|cerr[aá]|termina|archiva)\s+(?:la\s+)?continuidad\b/i,
            /\b(?:end|finish|archive)\s+continuity\b/i,
            /^\s*\/(?:end-cont|fin-cont)\b/i,
        ],
    },
    {
        kind: "status",
        confidence: 0.9,
        reason: "explicit continuity status request",
        patterns: [
            /\b(?:estado|status)\s+(?:de\s+)?(?:continuidad|continuity)\b/i,
            /^\s*\/(?:start-cont|plan-cont|init-cont)\s+status\b/i,
        ],
    },
    {
        kind: "init",
        confidence: 0.9,
        reason: "explicit continuity initialization request",
        patterns: [
            /\b(?:inicializa|inicia|prepara)\s+(?:la\s+)?continuidad\b/i,
            /\binit(?:ialize)?\s+continuity\b/i,
            /^\s*\/init-cont\b/i,
        ],
    },
    {
        kind: "update_plan",
        confidence: 0.92,
        reason: "explicit plan update request",
        patterns: [
            /(?:agrega|agreg[aá]|sum[aá]|a[nñ]ade|met[eé]|incorpora)[\s\S]{0,80}plan/i,
            /\b(?:add|append|include|incorporate)\b[\s\S]{0,80}\bplan\b/i,
            /\b(?:actualiza|update)\b[\s\S]{0,80}\bplan\b/i,
        ],
    },
    {
        kind: "plan",
        confidence: 0.85,
        reason: "explicit planning request",
        patterns: [
            /\b(?:planifica|planea|arma\s+el\s+plan|replanifica)\b/i,
            /\b(?:plan|replan|make\s+a\s+plan)\b[\s\S]{0,80}\b(?:continuity|continuidad|queue|cola)\b/i,
            /^\s*\/plan-cont\b/i,
        ],
    },
    {
        kind: "start",
        confidence: 0.85,
        reason: "explicit continuity execution request",
        patterns: [
            /\b(?:contin[uú]a|ejecuta\s+cola|no\s+pares|hac[eé]\s+todo\s+lo\s+que\s+puedas)\b/i,
            /\b(?:continue|start|execute)\b[\s\S]{0,80}\b(?:continuity|queue|plan)\b/i,
            /^\s*\/start-cont\b/i,
        ],
    },
    {
        kind: "checkpoint",
        confidence: 0.8,
        reason: "explicit checkpoint request",
        patterns: [
            /\b(?:checkpoint|guarda\s+estado|actualiza\s+estado|save\s+state)\b/i,
            /\b(?:next\s+action|pr[oó]xima\s+acci[oó]n)\b/i,
        ],
    },
];
export function detectContinuityIntent(text) {
    const normalizedText = text.trim();
    if (!normalizedText) {
        return createNoneIntent(text, "empty input");
    }
    for (const rule of INTENT_RULES) {
        if (rule.patterns.some((pattern) => pattern.test(normalizedText))) {
            return {
                kind: rule.kind,
                confidence: rule.confidence,
                reason: rule.reason,
                text,
            };
        }
    }
    return createNoneIntent(text, "no continuity intent matched");
}
function createNoneIntent(text, reason) {
    return {
        kind: "none",
        confidence: 0,
        reason,
        text,
    };
}
//# sourceMappingURL=continuity-intent-router.js.map