import type { APIStringSelectComponent } from "discord-api-types/v10"; import { Button, type ButtonInteraction, type ComponentData, StringSelectMenu, type StringSelectMenuInteraction } from "@buape/carbon"; import { ButtonStyle } from "discord-api-types/v10"; import type { OpenClawConfig } from "../../config/config.js"; import { type DiscordGuildEntryResolved } from "./allow-list.js"; export type AgentComponentContext = { cfg: OpenClawConfig; accountId: string; guildEntries?: Record; /** DM allowlist (from dm.allowFrom config) */ allowFrom?: Array; /** DM policy (default: "pairing") */ dmPolicy?: "open" | "pairing" | "allowlist" | "disabled"; }; /** * Build agent button custom ID: agent:componentId= * The channelId is NOT embedded in customId - we use interaction.rawData.channel_id instead * to prevent channel spoofing attacks. * * Carbon's customIdParser parses "key:arg1=value1;arg2=value2" into { arg1: value1, arg2: value2 } */ export declare function buildAgentButtonCustomId(componentId: string): string; /** * Build agent select menu custom ID: agentsel:componentId= */ export declare function buildAgentSelectCustomId(componentId: string): string; export declare class AgentComponentButton extends Button { label: string; customId: string; style: ButtonStyle; private ctx; constructor(ctx: AgentComponentContext); run(interaction: ButtonInteraction, data: ComponentData): Promise; } export declare class AgentSelectMenu extends StringSelectMenu { customId: string; options: APIStringSelectComponent["options"]; private ctx; constructor(ctx: AgentComponentContext); run(interaction: StringSelectMenuInteraction, data: ComponentData): Promise; } export declare function createAgentComponentButton(ctx: AgentComponentContext): Button; export declare function createAgentSelectMenu(ctx: AgentComponentContext): StringSelectMenu;