Builds a case-insensitive regex pattern matching @mentions of a name for triggering agent invocation.
// Source: https://github.com/wexare-ai/openbrowserclaw | License: MIT | Copyright 2026 Sacha Arbonel
// Provided via justclaw.it.com; keep this notice with the code.
// ---------------------------------------------------------------------------
// OpenBrowserClaw — Configuration constants
// ---------------------------------------------------------------------------
/** Default assistant name (used in trigger pattern) */
export const ASSISTANT_NAME = 'Andy';
/** Trigger pattern — messages must match this to invoke the agent */
export function buildTriggerPattern(name: string): RegExp {
const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
return new RegExp(`(^|\\s)@${escaped}\\b`, 'i');
}
export const TRIGGER_PATTERN = buildTriggerPattern(ASSISTANT_NAME);
/** How many recen
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key