Functional Sub-Spec: Message CRUD & Export Engine
Requirements Traceability
[FUNC-003]: Message CRUD Operations
[FUNC-006]: Message Export Engine
Detailed Functional Descriptions
[FUNC-003] Message CRUD Operations
The system must support full CRUD management for messages in chats and forum topics:
Create / Send Message & Attachments:
grm msg send [-a|–attach <file>] [-m|–media] [-C|–caption “<text>”] [-t|–topic <id>] <chat_id> [“<message>”]: Send text message or upload single/multi-file document/media attachments.
Read / List / Search / Info:
grm msg ls [-t|–topic <id>] [-n|–limit <N>] <chat_id>: List recent messages from chat or topic.
grm msg info <chat_id> <message_id>: View detailed metadata for a single message (ID, Sender, Timestamp, Edit State, Views/Reactions).
grm msg search [-t|–topic <id>] [-q|–query “<pattern>”] [-n|–limit <N>] <chat_id>: Search message stream using query regex pattern filter.
Update / Edit Message:
grm msg edit [-t|–topic <id>] <chat_id> <message_id> “<new_text>”: Edit existing text content of an sent message.
Delete Message:
grm msg delete [–for-everyone] <chat_id> <message_ids…>: Delete one or multiple messages by ID (for self or for all chat members).
[FUNC-006] Message Export Engine
The system must export chat and topic histories to structured files:
grm msg export [-f|–format csv|json] [-o|–output <file>] [-t|–topic <id>] [-n|–limit <N>] <chat_id>: Extract up to N messages and write to JSON or CSV file.