/** * Slash command map — turns `/command args` messages from messengers into RPC calls. * * Layer ordering (matches previous extension behaviour, minus the conflicts): * 1. Bridge admin commands (/help, /trusted, ...) are handled by ChallengeAuth before this module * 2. Builtin pi commands that have a dedicated RPC command are mapped here * 3. Everything else starting with "/" is forwarded via prompt: extension commands, * skill commands (/skill:name) and prompt templates (/template) are expanded by pi itself * 4. Unknown commands get a helpful error listing what is available */ import type { PiRpc } from "./pi-rpc.js"; import type { ProjectManager } from "./project-manager.js"; export interface SlashCommandContext { rpc: PiRpc; /** Send a reply back to the originating chat */ reply: (text: string) => Promise; /** Multi-project management (project rooms). Optional. */ projectManager?: ProjectManager; /** Create a private room + invite a user (Matrix). Optional. */ createProjectRoom?: (name: string, inviteUserId: string) => Promise; /** Admin user MXID (invite target for /pmctl new), e.g. matrix:@barry:server. */ adminUserId?: string; /** The user who sent this command (invite target for /pmctl new). */ senderUserId?: string; /** The room this command came from. */ chatId?: string; /** Whether this room is the management room (first paired DM). */ isManagementRoom?: boolean; /** Whether multi-project mode is active (for /pmctl availability). */ isMultiProject?: boolean; /** Rename a room via the Matrix transport (optional). */ setRoomName?: (roomId: string, name: string) => Promise; /** Have the bot leave a room via the Matrix transport (optional). */ leaveRoom?: (roomId: string, reason?: string) => Promise; /** Promote a user in a room via the Matrix transport (optional). */ setUserPowerLevel?: (roomId: string, userId: string, level: number) => Promise; } /** Returns true if the command was handled (something was done / replied). */ export declare function handleSlashCommand(text: string, ctx: SlashCommandContext): Promise; //# sourceMappingURL=command-map.d.ts.map