Skip to content

Commit b8af0da

Browse files
committed
added wandConfig for slack block kit
1 parent de63a02 commit b8af0da

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

apps/sim/blocks/blocks/slack.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
233233
id: 'blocks',
234234
title: 'Block Kit Blocks',
235235
type: 'code',
236+
language: 'json',
236237
placeholder: 'JSON array of Block Kit blocks',
237238
condition: {
238239
field: 'operation',
@@ -244,6 +245,54 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
244245
value: ['send', 'ephemeral', 'update'],
245246
and: { field: 'messageFormat', value: 'blocks' },
246247
},
248+
generationType: 'json-object',
249+
wandConfig: {
250+
enabled: true,
251+
maintainHistory: true,
252+
generationType: 'json-object',
253+
prompt: `You are an expert at Slack Block Kit.
254+
Generate ONLY a valid JSON array of Block Kit blocks based on the user's request.
255+
The output MUST be a JSON array starting with [ and ending with ].
256+
257+
Current blocks: {context}
258+
259+
Available block types for messages:
260+
- "section": Displays text with an optional accessory element. Text uses { "type": "mrkdwn", "text": "..." } or { "type": "plain_text", "text": "..." }.
261+
- "header": Large text header. Text must be plain_text.
262+
- "divider": A horizontal rule separator. No fields needed besides type.
263+
- "image": Displays an image. Requires "image_url" and "alt_text".
264+
- "context": Contextual info with an "elements" array of image and text objects.
265+
- "actions": Interactive elements like buttons. Each button needs "type": "button", a "text" object, and an "action_id".
266+
- "rich_text": Structured rich text with "elements" array of rich_text_section objects.
267+
268+
Example output:
269+
[
270+
{
271+
"type": "header",
272+
"text": { "type": "plain_text", "text": "Order Confirmation" }
273+
},
274+
{
275+
"type": "section",
276+
"text": { "type": "mrkdwn", "text": "Your order *#1234* has been confirmed." }
277+
},
278+
{ "type": "divider" },
279+
{
280+
"type": "actions",
281+
"elements": [
282+
{
283+
"type": "button",
284+
"text": { "type": "plain_text", "text": "View Order" },
285+
"action_id": "view_order",
286+
"url": "https://example.com/orders/1234"
287+
}
288+
]
289+
}
290+
]
291+
292+
You can reference workflow variables using angle brackets, e.g., <blockName.output>.
293+
Do not include any explanations, markdown formatting, or other text outside the JSON array.`,
294+
placeholder: 'Describe the Block Kit layout you want to create...',
295+
},
247296
},
248297
{
249298
id: 'threadTs',

0 commit comments

Comments
 (0)