From 8994bce8773909c84880896f23a300b41a0d7f86 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Wed, 28 Oct 2026 09:48:04 -0700 Subject: [PATCH] fix(types): add agent prompt and visibility fields to the Button block element --- .changeset/button-agent-prompt-fields.md | 5 +++++ packages/types/src/block-kit/block-elements.ts | 14 ++++++++++++++ packages/types/test/block-elements.test-d.ts | 15 ++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .changeset/button-agent-prompt-fields.md diff --git a/.changeset/button-agent-prompt-fields.md b/.changeset/button-agent-prompt-fields.md new file mode 100644 index 000000000..79cc68c86 --- /dev/null +++ b/.changeset/button-agent-prompt-fields.md @@ -0,0 +1,5 @@ +--- +"@slack/types": patch +--- + +fix(types): add the `agent_prompt`, `agent_prompt_display`, and `visible_to_user_ids` fields to the [`Button`](https://docs.slack.dev/reference/block-kit/block-elements/button-element) block element diff --git a/packages/types/src/block-kit/block-elements.ts b/packages/types/src/block-kit/block-elements.ts index 87c59e6a2..e20b467c0 100644 --- a/packages/types/src/block-kit/block-elements.ts +++ b/packages/types/src/block-kit/block-elements.ts @@ -61,6 +61,20 @@ export interface Button extends Actionable, Confirmable { * readers instead of the button `text` object. Maximum length for this field is 75 characters. */ accessibility_label?: string; + /** + * @description A prompt sent to Slackbot when the button is clicked, if Slackbot AI is available to the user. + * Maximum length for this field is 4000 characters. + */ + agent_prompt?: string; + /** + * @description Short text shown instead of the full `agent_prompt` in the user's Slackbot message. Requires + * `agent_prompt` and defaults to the button's `text`. + */ + agent_prompt_display?: string; + /** + * @description An array of user IDs for which the button appears. If not provided, the button is visible to all users. + */ + visible_to_user_ids?: string[]; } /** diff --git a/packages/types/test/block-elements.test-d.ts b/packages/types/test/block-elements.test-d.ts index 0019f74a5..613819e0a 100644 --- a/packages/types/test/block-elements.test-d.ts +++ b/packages/types/test/block-elements.test-d.ts @@ -1,5 +1,5 @@ import { expectAssignable, expectError } from 'tsd'; -import type { RichTextInput, WorkflowButton } from '../src/index'; +import type { Button, RichTextInput, WorkflowButton } from '../src/index'; // RichTextInput — happy paths expectAssignable({ @@ -43,3 +43,16 @@ expectAssignable({ }, }, }); + +// Button with agent prompt and visibility fields +expectAssignable