getCommands

Extracts command names from the dispatch payload. Supports both a DataList of strings (multiple commands) and a single String, matching the behavior of the Swift Dispatch+Commands extension.

Blank and non-String commands are ignored, and duplicate commands are removed, keeping the first occurrence and preserving the order. Two commands are duplicates if they are equal once trimmed of whitespace and lowercased, which is how commands are matched when executed. Duplicates are removed only from the returned list: the payload's "command_name" is left unchanged, so anything reading it directly may still see duplicates.

Return

the list of unique command names; empty if there are none.