From 813cefc9f6c9ac5a9fd65c6fcdc802ccabde12f6 Mon Sep 17 00:00:00 2001 From: Darwin Wu Date: Sun, 6 Sep 2026 13:35:32 -0700 Subject: [PATCH 1/2] feat: schedule messages with browser auth --- README.md | 16 +- llms.txt | 2 +- skills/agent-slack/SKILL.md | 4 +- skills/agent-slack/references/output.md | 2 +- src/cli/message-actions.ts | 50 ++++-- src/cli/message-command.ts | 11 +- src/cli/message-draft-actions.ts | 7 +- src/cli/message-scheduled-actions.ts | 23 ++- src/cli/message-scheduled-command.ts | 10 +- src/cli/slack-native-draft-endpoint.ts | 119 ++++++++++++++ src/slack/drafts.ts | 37 ++++- src/slack/native-scheduled-messages.ts | 128 +++++++++++++++ src/slack/scheduled-messages.ts | 58 ++++++- test/drafts.test.ts | 43 ++++- test/help-contracts.test.ts | 4 + test/message-draft-actions.test.ts | 17 +- test/message-send.test.ts | 193 ++++++++++++++++++++++- test/slack-native-draft-endpoint.test.ts | 138 ++++++++++++++++ 18 files changed, 816 insertions(+), 46 deletions(-) create mode 100644 src/cli/slack-native-draft-endpoint.ts create mode 100644 src/slack/native-scheduled-messages.ts create mode 100644 test/slack-native-draft-endpoint.test.ts diff --git a/README.md b/README.md index 7fb9c07..c55650f 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,8 @@ agent-slack message draft create "#general" "Latest numbers" --attach ./q3.png - agent-slack message draft update "DR_ID" "Latest numbers" --attach ./appendix.pdf ``` +Native draft listings read at most 100 records. Their JSON includes `"has_more": true` when Slack reports additional drafts; the internal API does not expose a cursor for retrieving them. + ### Safe mode (enforced human-in-the-loop) Skill instructions like "always use `draft`, never `send`" are guidance an agent can ignore. Safe mode enforces it at the tool level — useful when an AI agent has access to `agent-slack` and you want a guarantee that nothing posts without human review. @@ -304,10 +306,10 @@ agent-slack message delete "#general" --workspace "myteam" --ts "1770165109.6283 Send options for `message send`: - `--attach ` upload a local file (repeatable; `` is optional when attaching files) -- `--blocks ` send raw [Block Kit](https://docs.slack.dev/block-kit/) blocks from a JSON file (or `-` for stdin). Bypasses the automatic markdown-to-rich-text conversion, unlocking header/divider/section/table blocks and other structured layouts. Cannot be combined with `--attach`. +- `--blocks ` send raw [Block Kit](https://docs.slack.dev/block-kit/) blocks from a JSON file (or `-` for stdin). Bypasses the automatic markdown-to-rich-text conversion, unlocking header/divider/section/table blocks and other structured layouts. Browser-auth scheduled sends accept only non-empty top-level `rich_text` blocks because Slack Desktop strips or tombstones other native-draft content. Cannot be combined with `--attach`. - `--reply-broadcast` when replying in a thread, also post the reply to the parent channel (Slack's "Also send to #channel" checkbox). For channel targets, pair with `--thread-ts`; for URL targets, the thread context is derived from the message. Not supported for DM targets; cannot be combined with `--attach`. -- `--no-unfurl` suppress Slack link and media previews. Also available on `message compose`; cannot be combined with `--attach`. -- `--schedule