import type { Message } from "discord.js"; /** * v1.2 §4.5 — Owner-only gate (default ON for fresh installs; OFF for * v1.1.0 upgrades to preserve v1.0.2 channel-ACL-only behavior — the * migration writes `owner_only: false` explicitly so the resolver never * has to guess). * * The bot processes a message iff * `message.author.id === user.yaml.messenger_user_id`. * Other senders in the same channel are silently ignored. Each * unrecognized sender gets *one* ephemeral notice per cooldown window so * the channel does not flood — every subsequent message from the same * (guild, sender) pair is fully silent. * * v1.0.2 was wrong-by-omission: it removed the author-guard because the * *channel name* at the time was user-id based, so the bot could not * tell which user's channel it was looking at — disambiguation was * impossible without the channel mapping that landed in v0.8.0 * (`command-` / `works-`). With channel recognition * solved, the owner-id check becomes both feasible and the right policy * for a personal Chief bot. v1.2 restores it; existing installs keep * v1.0.2 behavior unless they opt in. */ export interface OwnerGateContext { workspace: string; orgSlug: string | null; ownHandle: string | null; } export interface OwnerGateDecision { /** When true the messageCreate handler should continue processing. */ allow: boolean; /** When set, send this string to the message author as an ephemeral. */ ephemeralNotice?: string; } /** * Decide whether to allow / silently ignore / silently-with-ephemeral the * incoming message. Pure-ish (mutates only the in-memory dedupe log). * No Discord API calls — caller handles the actual `interaction.reply` * style ephemeral send (regular `Message` doesn't support ephemeral * directly, so callers typically `channel.send` then auto-delete, or use * a DM fallback). */ export declare function decideOwnerGate(message: Message, ctx: OwnerGateContext): OwnerGateDecision; /** * Test helpers — exported so unit tests can reset state between cases * without exporting the internal Map. */ export declare function _resetOwnerGateState(): void;