@@ -26,6 +26,8 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
2626 { label : 'Send Message' , id : 'send' } ,
2727 { label : 'Create Canvas' , id : 'canvas' } ,
2828 { label : 'Read Messages' , id : 'read' } ,
29+ { label : 'Get Message' , id : 'get_message' } ,
30+ { label : 'Get Thread' , id : 'get_thread' } ,
2931 { label : 'List Channels' , id : 'list_channels' } ,
3032 { label : 'List Channel Members' , id : 'list_members' } ,
3133 { label : 'List Users' , id : 'list_users' } ,
@@ -316,6 +318,68 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
316318 } ,
317319 required : true ,
318320 } ,
321+ // Get Message specific fields
322+ {
323+ id : 'getMessageTimestamp' ,
324+ title : 'Message Timestamp' ,
325+ type : 'short-input' ,
326+ placeholder : 'Message timestamp (e.g., 1405894322.002768)' ,
327+ condition : {
328+ field : 'operation' ,
329+ value : 'get_message' ,
330+ } ,
331+ required : true ,
332+ wandConfig : {
333+ enabled : true ,
334+ prompt : `Extract or generate a Slack message timestamp from the user's input.
335+ Slack message timestamps are in the format: XXXXXXXXXX.XXXXXX (seconds.microseconds since Unix epoch).
336+ Examples:
337+ - "1405894322.002768" -> 1405894322.002768 (already a valid timestamp)
338+ - "thread_ts from the trigger" -> The user wants to reference a variable, output the original text
339+ - A URL like "https://slack.com/archives/C123/p1405894322002768" -> Extract 1405894322.002768 (remove 'p' prefix, add decimal after 10th digit)
340+
341+ If the input looks like a reference to another block's output (contains < and >) or a variable, return it as-is.
342+ Return ONLY the timestamp string - no explanations, no quotes, no extra text.` ,
343+ placeholder : 'Paste a Slack message URL or timestamp...' ,
344+ generationType : 'timestamp' ,
345+ } ,
346+ } ,
347+ // Get Thread specific fields
348+ {
349+ id : 'getThreadTimestamp' ,
350+ title : 'Thread Timestamp' ,
351+ type : 'short-input' ,
352+ placeholder : 'Thread timestamp (thread_ts, e.g., 1405894322.002768)' ,
353+ condition : {
354+ field : 'operation' ,
355+ value : 'get_thread' ,
356+ } ,
357+ required : true ,
358+ wandConfig : {
359+ enabled : true ,
360+ prompt : `Extract or generate a Slack thread timestamp from the user's input.
361+ Slack thread timestamps (thread_ts) are in the format: XXXXXXXXXX.XXXXXX (seconds.microseconds since Unix epoch).
362+ Examples:
363+ - "1405894322.002768" -> 1405894322.002768 (already a valid timestamp)
364+ - "thread_ts from the trigger" -> The user wants to reference a variable, output the original text
365+ - A URL like "https://slack.com/archives/C123/p1405894322002768" -> Extract 1405894322.002768 (remove 'p' prefix, add decimal after 10th digit)
366+
367+ If the input looks like a reference to another block's output (contains < and >) or a variable, return it as-is.
368+ Return ONLY the timestamp string - no explanations, no quotes, no extra text.` ,
369+ placeholder : 'Paste a Slack thread URL or thread_ts...' ,
370+ generationType : 'timestamp' ,
371+ } ,
372+ } ,
373+ {
374+ id : 'threadLimit' ,
375+ title : 'Message Limit' ,
376+ type : 'short-input' ,
377+ placeholder : '100' ,
378+ condition : {
379+ field : 'operation' ,
380+ value : 'get_thread' ,
381+ } ,
382+ } ,
319383 {
320384 id : 'oldest' ,
321385 title : 'Oldest Timestamp' ,
@@ -430,6 +494,8 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
430494 'slack_message' ,
431495 'slack_canvas' ,
432496 'slack_message_reader' ,
497+ 'slack_get_message' ,
498+ 'slack_get_thread' ,
433499 'slack_list_channels' ,
434500 'slack_list_members' ,
435501 'slack_list_users' ,
@@ -448,6 +514,10 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
448514 return 'slack_canvas'
449515 case 'read' :
450516 return 'slack_message_reader'
517+ case 'get_message' :
518+ return 'slack_get_message'
519+ case 'get_thread' :
520+ return 'slack_get_thread'
451521 case 'list_channels' :
452522 return 'slack_list_channels'
453523 case 'list_members' :
@@ -498,6 +568,9 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
498568 includeDeleted,
499569 userLimit,
500570 userId,
571+ getMessageTimestamp,
572+ getThreadTimestamp,
573+ threadLimit,
501574 ...rest
502575 } = params
503576
@@ -574,6 +647,27 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
574647 break
575648 }
576649
650+ case 'get_message' :
651+ if ( ! getMessageTimestamp ) {
652+ throw new Error ( 'Message timestamp is required for get message operation' )
653+ }
654+ baseParams . timestamp = getMessageTimestamp
655+ break
656+
657+ case 'get_thread' : {
658+ if ( ! getThreadTimestamp ) {
659+ throw new Error ( 'Thread timestamp is required for get thread operation' )
660+ }
661+ baseParams . threadTs = getThreadTimestamp
662+ if ( threadLimit ) {
663+ const parsedLimit = Number . parseInt ( threadLimit , 10 )
664+ if ( ! Number . isNaN ( parsedLimit ) && parsedLimit > 0 ) {
665+ baseParams . limit = Math . min ( parsedLimit , 200 )
666+ }
667+ }
668+ break
669+ }
670+
577671 case 'list_channels' : {
578672 baseParams . includePrivate = includePrivate !== 'false'
579673 baseParams . excludeArchived = true
@@ -679,6 +773,14 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
679773 userLimit : { type : 'string' , description : 'Maximum number of users to return' } ,
680774 // Get User inputs
681775 userId : { type : 'string' , description : 'User ID to look up' } ,
776+ // Get Message inputs
777+ getMessageTimestamp : { type : 'string' , description : 'Message timestamp to retrieve' } ,
778+ // Get Thread inputs
779+ getThreadTimestamp : { type : 'string' , description : 'Thread timestamp to retrieve' } ,
780+ threadLimit : {
781+ type : 'string' ,
782+ description : 'Maximum number of messages to return from thread' ,
783+ } ,
682784 } ,
683785 outputs : {
684786 // slack_message outputs (send operation)
@@ -706,6 +808,24 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
706808 'Array of message objects with comprehensive properties: text, user, timestamp, reactions, threads, files, attachments, blocks, stars, pins, and edit history' ,
707809 } ,
708810
811+ // slack_get_thread outputs (get_thread operation)
812+ parentMessage : {
813+ type : 'json' ,
814+ description : 'The thread parent message with all properties' ,
815+ } ,
816+ replies : {
817+ type : 'json' ,
818+ description : 'Array of reply messages in the thread (excluding the parent)' ,
819+ } ,
820+ replyCount : {
821+ type : 'number' ,
822+ description : 'Number of replies returned in this response' ,
823+ } ,
824+ hasMore : {
825+ type : 'boolean' ,
826+ description : 'Whether there are more messages in the thread' ,
827+ } ,
828+
709829 // slack_list_channels outputs (list_channels operation)
710830 channels : {
711831 type : 'json' ,
0 commit comments