Skip to content

feat(message send): add --blocks flag for raw Block Kit payloads#89

Merged
AmethystLiang merged 3 commits intomainfrom
feat/blocks-flag
May 5, 2026
Merged

feat(message send): add --blocks flag for raw Block Kit payloads#89
AmethystLiang merged 3 commits intomainfrom
feat/blocks-flag

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

@AmethystLiang AmethystLiang commented May 5, 2026

Continues #82 (cannot push to that fork). Adds element-object validation on top of the original.

Original work by @thehesiod in #82. Resolved merge with main and added validation that each element of the parsed blocks array is an object so non-object entries produce a clear local error rather than a Slack-side rejection.

Closes #82

Made with Orca 🐋

amohr-northstar and others added 3 commits April 18, 2026 14:08
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>
@AmethystLiang AmethystLiang merged commit 7eb9796 into main May 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants