feat(message): Slack-native drafts — message drafts list/create/update/delete#112
Closed
mikaelq wants to merge 1 commit into
Closed
feat(message): Slack-native drafts — message drafts list/create/update/delete#112mikaelq wants to merge 1 commit into
mikaelq wants to merge 1 commit into
Conversation
Add 'message drafts <list|create|update|delete>' backed by Slack's undocumented drafts.* session endpoints, so agents can read and write drafts that show up natively in the user's Slack client. The existing 'message draft' browser editor is unchanged. References stablyai#83 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nwparker
added a commit
that referenced
this pull request
Jul 18, 2026
Rename the browser-editor command `message draft` → `message compose`, and add Slack-native drafts under `message draft <list|create|update|delete>`, backed by Slack's undocumented drafts.* session endpoints so drafts show up natively in the user's Slack client. Takes the "compose" direction (option 2 from #83) so the two concepts get distinct names instead of the near-homograph draft/drafts pair. Reuses the drafts.* API layer from #112 (originally by @mikaelq). Hardening in the update path: - refuses drafts it can't faithfully round-trip (scheduled or multi- destination) instead of silently dropping the schedule/recipients; - broadcast is inherited only when the destination is unchanged, so re-addressing never ratchets a reply into a new channel; adds `--no-broadcast` to clear an inherited flag; - rejects `--broadcast` for DM targets, matching `message send`; - `findDraft` prefers a well-formed record if the list response has a malformed duplicate. BREAKING CHANGE: `message draft <target> [text]` no longer opens the editor; use `message compose`. Old usage errors cleanly; `message draft --help` points to compose. No backwards-compat shim. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
nwparker
added a commit
that referenced
this pull request
Jul 18, 2026
Rename the browser-editor command `message draft` → `message compose`, and add Slack-native drafts under `message draft <list|create|update|delete>`, backed by Slack's undocumented drafts.* session endpoints so drafts show up natively in the user's Slack client. Takes the "compose" direction (option 2 from #83) so the two concepts get distinct names instead of the near-homograph draft/drafts pair. Reuses the drafts.* API layer from #112 (originally by @mikaelq). Hardening in the update path: - refuses drafts it can't faithfully round-trip (scheduled or multi- destination) instead of silently dropping the schedule/recipients; - broadcast is inherited only when the destination is unchanged, so re-addressing never ratchets a reply into a new channel; adds `--no-broadcast` to clear an inherited flag; - rejects `--broadcast` for DM targets, matching `message send`; - `findDraft` prefers a well-formed record if the list response has a malformed duplicate. BREAKING CHANGE: `message draft <target> [text]` no longer opens the editor; use `message compose`. Old usage errors cleanly; `message draft --help` points to compose. No backwards-compat shim. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
nwparker
added a commit
that referenced
this pull request
Jul 18, 2026
Rename the browser-editor command `message draft` → `message compose`, and add Slack-native drafts under `message draft <list|create|update|delete>`, backed by Slack's undocumented drafts.* session endpoints so drafts show up natively in the user's Slack client. Takes the "compose" direction (option 2 from #83) so the two concepts get distinct names instead of the near-homograph draft/drafts pair. Reuses the drafts.* API layer from #112 (originally by @mikaelq). Hardening in the update path: - refuses drafts it can't faithfully round-trip (scheduled or multi- destination) instead of silently dropping the schedule/recipients; - broadcast is inherited only when the destination is unchanged, so re-addressing never ratchets a reply into a new channel; adds `--no-broadcast` to clear an inherited flag; - rejects `--broadcast` for DM targets, matching `message send`; - `findDraft` prefers a well-formed record if the list response has a malformed duplicate. BREAKING CHANGE: `message draft <target> [text]` no longer opens the editor; use `message compose`. Old usage errors cleanly; `message draft --help` points to compose. No backwards-compat shim. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
nwparker
added a commit
that referenced
this pull request
Jul 18, 2026
Rename the browser-editor command `message draft` → `message compose`, and add Slack-native drafts under `message draft <list|create|update|delete>`, backed by Slack's undocumented drafts.* session endpoints so drafts show up natively in the user's Slack client. Takes the "compose" direction (option 2 from #83) so the two concepts get distinct names instead of the near-homograph draft/drafts pair. Reuses the drafts.* API layer from #112 (originally by @mikaelq). Hardening in the update path: - refuses drafts it can't faithfully round-trip (scheduled or multi- destination) instead of silently dropping the schedule/recipients; - broadcast is inherited only when the destination is unchanged, so re-addressing never ratchets a reply into a new channel; adds `--no-broadcast` to clear an inherited flag; - rejects `--broadcast` for DM targets, matching `message send`; - `findDraft` prefers a well-formed record if the list response has a malformed duplicate. BREAKING CHANGE: `message draft <target> [text]` no longer opens the editor; use `message compose`. Old usage errors cleanly; `message draft --help` points to compose. No backwards-compat shim. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GPT-5.6-Sol <noreply@openai.com>
Contributor
|
Superseded by #119 (now merged), which implements #83 via the "compose" direction: It reuses your |
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.
Implements #83 (option 1: separate plural
draftssubcommand, keeping the existingmessage draftbrowser editor unchanged).What
New
message draftssubcommand group backed by Slack's undocumenteddrafts.*session endpoints (the same API the official clients use), so agents can read and write drafts that show up natively in the user's Slack client:createaccepts the usual targets:#channel/name, channel id, user id (opens a DM), or a message URL (drafts a thread reply, same semantics asmessage send).rich_textconversion (textToRichTextBlocks), so lists/bold/code/mentions render natively.updatereplaces the body but preserves the draft's destination and attached files unless overridden; the conflict-detectionclient_last_updated_tsis auto-fetched forupdate/deletewhen omitted (including Slack's 7-digit fractional-padding quirk).listresolves channel/DM display names best-effort.later,unreads); noted in the docs.Structure
Follows the
message scheduledpattern:src/slack/drafts.ts(API layer) +src/cli/message-drafts-actions.ts/message-drafts-command.ts(CLI layer). Docs updated in README,skills/agent-slack/SKILL.md, andreferences/commands.md.Testing
test/drafts.test.ts(wire payloads, ts padding, parsing, auto-fetch/error paths); full suite, typecheck, lint, and format all pass.Closes #83
🤖 Generated with Claude Code