feat(message send): add --blocks flag for raw Block Kit payloads#88
Closed
AmethystLiang wants to merge 3 commits intomainfrom
Closed
feat(message send): add --blocks flag for raw Block Kit payloads#88AmethystLiang wants to merge 3 commits intomainfrom
AmethystLiang wants to merge 3 commits intomainfrom
Conversation
Adds a `--blocks <path>` option to `message send` that reads a JSON array of Block Kit blocks from a file (or `-` for stdin) and passes it to chat.postMessage as-is, bypassing the built-in markdown-to-rich-text conversion. This unlocks structured layouts that the markdown converter can't express — headers, dividers, context blocks, and especially the `table` block introduced by Slack in August 2025. User tokens already have the `chat:write` scope needed, so no new auth setup is required. The positional <text> argument (when provided alongside --blocks) is still sent as the message `text` fallback for notifications and unfurls. `--blocks` cannot be combined with `--attach` since uploads take a separate code path. - CLI: add --blocks option with mutual-exclusion check vs --attach - Actions: loadBlocksFromPath() reads/parses/validates JSON array; sendMessage() prefers loaded blocks over markdown conversion - README + skill docs: document the flag with a table-block example - Tests: 4 new cases covering happy path, non-array JSON, malformed JSON, and precedence over text-derived blocks
Reject non-object elements in the parsed blocks array with a clear local error rather than letting Slack reject the payload. Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Orca <help@stably.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges #82 with element-object validation added.
Original PR #82 by @thehesiod. Adds element validation to
loadBlocksFromPathso non-object array entries produce a clear local error.Closes #82
Made with Orca 🐋