/** * Canonical message action contract for Athena discussion UI. * Presentation-only: consumers pass identity/permissions/state; this module * derives which actions are available vs disabled and why. */ export type ChatMessageAction = "reply" | "edit" | "delete" | "copy" | "retry" | "react" | "open-reference" | "open-attachment" | "custom"; /** Client-visible delivery lifecycle (maps to backend send + optimistic UX). */ export type ChatMessageDeliveryState = "draft" | "queued" | "uploading" | "sending" | "sent" | "upload_failed" | "send_failed" | "retrying" | "edited" | "deleted"; export interface ChatMessageActionContext { /** Attachment-only messages cannot be edited for text. */ attachmentOnly?: boolean; /** Consumer can moderate (delete others, etc.). */ canModerate?: boolean; /** Consumer may react on this message. */ canReact?: boolean; /** Delivery / lifecycle state. Defaults to sent when omitted. */ deliveryState?: ChatMessageDeliveryState | null; /** Message has one or more attachments. */ hasAttachments?: boolean; /** Message has non-empty editable text body. */ hasEditableText?: boolean; /** Message has a reply target reference. */ hasReference?: boolean; /** Current user authored the message. */ isAuthor?: boolean; /** Soft-deleted / tombstone. */ isDeleted?: boolean; /** * Optional hard policy overrides. `false` removes the action entirely; * `true` does not force-enable past safety rules for failed/deleted states. */ policy?: Partial>; } export interface ChatMessageActionAvailability { action: ChatMessageAction; disabled: boolean; /** Machine-readable reason when disabled or hidden. */ reason?: string; visible: boolean; } /** * Resolves which standard message actions are visible/enabled for a message. */ export declare function resolveChatMessageActions(context?: ChatMessageActionContext): ChatMessageActionAvailability[]; /** * Convenience: list of enabled + visible action ids. */ export declare function listEnabledChatMessageActions(context?: ChatMessageActionContext): ChatMessageAction[]; /** * Compact flags for same-sender grouping in discussion lists. */ export declare function resolveGroupedMessagePresentation(input: { previousSenderId?: string | null; senderId: string; }): { compact: boolean; hideAvatar: boolean; hideMeta: boolean; };