// Chat intent classifier. Pure: given a message + bot context, returns one // of a small fixed set of intents. The reply generator and the // command-like-chat recorder both consume this, so the classifier is the // single source of truth for "what kind of thing did the human just say?" // // Categories are intentionally small and stable. New conversational nuances // should land as templates inside reply.js, not as new intents. export const INTENTS = Object.freeze({ GREETING: "greeting", STATUS_QUESTION: "status_question", ADDRESSED_BANTER: "addressed_banter", COMMAND_LIKE: "command_like", // ignored-and-recorded per Phase 0 UNSAFE_REQUEST: "unsafe_request", // logged into escalations AMBIENT: "ambient", // nothing the bot should react to }); // Unicode-aware word boundaries: JavaScript's \b only recognises ASCII // word characters, so "привет" wouldn't match \bпривет\b. We use Unicode // property escapes with lookarounds instead — any letter (Latin OR // Cyrillic OR anything else) on either side disqualifies, so partial // matches inside larger words still don't fire. const NOT_LETTER_BEFORE = "(?