(*--------------------------------------------------------------------------- Copyright (c) 2026 Anil Madhavapeddy . All rights reserved. SPDX-License-Identifier: ISC ---------------------------------------------------------------------------*) (** Command parsing for Poe bot. This module provides deterministic command parsing for the Poe Zulip bot. Unrecognized commands are passed through to Claude for interpretation. *) (** Admin sub-commands for storage and broadcast management. *) type admin_command = | Last_broadcast (** Show last broadcast time *) | Reset_broadcast of string (** Reset broadcast time to ISO timestamp *) | Storage_keys (** List all storage keys *) | Storage_get of string (** Get value for a storage key *) | Storage_delete of string (** Delete a storage key *) (** Parsed bot commands. *) type command = | Help (** Show help message *) | Status (** Show bot configuration status *) | Broadcast (** Broadcast new changes *) | Refresh (** Pull from remote, regenerate changes, and broadcast *) | Clear_session (** Clear conversation session for this channel/DM *) | Admin of admin_command (** Admin commands (require authorization) *) | Unknown of string (** Unrecognized command - pass to Claude *) val parse : string -> command (** [parse content] parses a message into a command. The input should be trimmed and lowercased. *) val admin_parse : string -> admin_command option (** [admin_parse args] parses admin sub-command arguments. Returns [None] if the arguments don't match any admin command. *)