mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 11:58:38 +00:00
Slack: gate interactive reply hints by capability
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
|||||||
resolveDefaultSlackAccountId,
|
resolveDefaultSlackAccountId,
|
||||||
resolveSlackAccount,
|
resolveSlackAccount,
|
||||||
resolveSlackReplyToMode,
|
resolveSlackReplyToMode,
|
||||||
|
isSlackInteractiveRepliesEnabled,
|
||||||
resolveSlackGroupRequireMention,
|
resolveSlackGroupRequireMention,
|
||||||
resolveSlackGroupToolPolicy,
|
resolveSlackGroupToolPolicy,
|
||||||
buildSlackThreadingToolContext,
|
buildSlackThreadingToolContext,
|
||||||
@@ -147,10 +148,15 @@ export const slackPlugin: ChannelPlugin<ResolvedSlackAccount> = {
|
|||||||
nativeCommands: true,
|
nativeCommands: true,
|
||||||
},
|
},
|
||||||
agentPrompt: {
|
agentPrompt: {
|
||||||
messageToolHints: () => [
|
messageToolHints: ({ cfg, accountId }) =>
|
||||||
"- Slack interactive replies: use `[[slack_buttons: Label:value, Other:other]]` to add action buttons that route clicks back as Slack interaction system events.",
|
isSlackInteractiveRepliesEnabled({ cfg, accountId })
|
||||||
"- Slack selects: use `[[slack_select: Placeholder | Label:value, Other:other]]` to add a static select menu that routes the chosen value back as a Slack interaction system event.",
|
? [
|
||||||
],
|
"- Slack interactive replies: use `[[slack_buttons: Label:value, Other:other]]` to add action buttons that route clicks back as Slack interaction system events.",
|
||||||
|
"- Slack selects: use `[[slack_select: Placeholder | Label:value, Other:other]]` to add a static select menu that routes the chosen value back as a Slack interaction system event.",
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
"- Slack interactive replies are disabled. If needed, ask to set `channels.slack.capabilities.interactiveReplies=true` (or the same under `channels.slack.accounts.<account>.capabilities`).",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
streaming: {
|
streaming: {
|
||||||
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
|
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
|
||||||
|
|||||||
@@ -1429,6 +1429,8 @@ export const FIELD_HELP: Record<string, string> = {
|
|||||||
"Optional Slack user token for workflows requiring user-context API access beyond bot permissions. Use sparingly and audit scopes because this token can carry broader authority.",
|
"Optional Slack user token for workflows requiring user-context API access beyond bot permissions. Use sparingly and audit scopes because this token can carry broader authority.",
|
||||||
"channels.slack.userTokenReadOnly":
|
"channels.slack.userTokenReadOnly":
|
||||||
"When true, treat configured Slack user token usage as read-only helper behavior where possible. Keep enabled if you only need supplemental reads without user-context writes.",
|
"When true, treat configured Slack user token usage as read-only helper behavior where possible. Keep enabled if you only need supplemental reads without user-context writes.",
|
||||||
|
"channels.slack.capabilities.interactiveReplies":
|
||||||
|
"Enable agent-authored Slack interactive reply directives (`[[slack_buttons: ...]]`, `[[slack_select: ...]]`). Default: false.",
|
||||||
"channels.mattermost.configWrites":
|
"channels.mattermost.configWrites":
|
||||||
"Allow Mattermost to write config in response to channel events/commands (default: true).",
|
"Allow Mattermost to write config in response to channel events/commands (default: true).",
|
||||||
"channels.discord.configWrites":
|
"channels.discord.configWrites":
|
||||||
|
|||||||
@@ -812,6 +812,7 @@ export const FIELD_LABELS: Record<string, string> = {
|
|||||||
"channels.slack.appToken": "Slack App Token",
|
"channels.slack.appToken": "Slack App Token",
|
||||||
"channels.slack.userToken": "Slack User Token",
|
"channels.slack.userToken": "Slack User Token",
|
||||||
"channels.slack.userTokenReadOnly": "Slack User Token Read Only",
|
"channels.slack.userTokenReadOnly": "Slack User Token Read Only",
|
||||||
|
"channels.slack.capabilities.interactiveReplies": "Slack Interactive Replies",
|
||||||
"channels.slack.streaming": "Slack Streaming Mode",
|
"channels.slack.streaming": "Slack Streaming Mode",
|
||||||
"channels.slack.nativeStreaming": "Slack Native Streaming",
|
"channels.slack.nativeStreaming": "Slack Native Streaming",
|
||||||
"channels.slack.streamMode": "Slack Stream Mode (Legacy)",
|
"channels.slack.streamMode": "Slack Stream Mode (Legacy)",
|
||||||
|
|||||||
Reference in New Issue
Block a user