Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.6 KB
Raw Blame
/**
 * Identity for the first-party "Macro" system bot. Mirrors
 * `bot_id::MACRO_AI_BOT_ID` on the backend. Macro is a global system bot
 * available in every channel; mentioning it triggers an AI reply in a thread.
 */
export const MACRO_AGENT_BOT_ID = '00000000-0000-0000-0000-00000000a1a1';

/**
 * Canonical principal id for Macro, matching the `bot|<uuid>` form used for
 * bot senders and participants everywhere else. New mentions must always use
 * this form; the bare UUID is only accepted for historical content.
 */
export const MACRO_AGENT_PRINCIPAL_ID = `bot|${MACRO_AGENT_BOT_ID}`;

/** Display name for Macro. */
export const MACRO_AGENT_NAME = 'Macro';

/**
 * User-facing name for Macro's built-in harness (`in-memory` / `macro-inmem`).
 * Wire slugs stay as they are; this is only what the UI prints.
 */
export const MACRO_HARNESS_NAME = 'Macro Agent';

/** Handle used to find Macro in the mention typeahead (`@macro`). */
export const MACRO_AGENT_HANDLE = 'macro';

/**
 * Whether an id refers to the Macro bot. Accepts both the bare UUID and
 * the `bot|<uuid>` participant/sender form.
 */
export function isMacroAgentId(id: string | undefined): boolean {
  if (!id) return false;
  const bare = id.startsWith('bot|') ? id.slice('bot|'.length) : id;
  return bare === MACRO_AGENT_BOT_ID;
}

/**
 * Whether an id is a bot principal: the canonical `bot|<uuid>` form used for
 * bot senders, participants, and mentions, or the Macro bot's bare UUID
 * (accepted for historical content only).
 */
export function isBotPrincipalId(id: string | undefined): boolean {
  return id?.startsWith('bot|') === true || isMacroAgentId(id);
}