feat: add Slack channel support

This commit is contained in:
Kamal
2026-02-04 23:26:20 +05:30
parent 795f8105a0
commit 051e396a8a
6 changed files with 249 additions and 1 deletions

View File

@@ -19,10 +19,31 @@ class TelegramConfig(BaseModel):
allow_from: list[str] = Field(default_factory=list) # Allowed user IDs or usernames
class SlackDMConfig(BaseModel):
"""Slack DM policy configuration."""
enabled: bool = True
policy: str = "open" # "open" or "allowlist"
allow_from: list[str] = Field(default_factory=list) # Allowed Slack user IDs
class SlackConfig(BaseModel):
"""Slack channel configuration."""
enabled: bool = False
mode: str = "socket" # "socket" supported
webhook_path: str = "/slack/events"
bot_token: str = "" # xoxb-...
app_token: str = "" # xapp-...
user_token_read_only: bool = True
group_policy: str = "open" # "open", "mention", "allowlist"
group_allow_from: list[str] = Field(default_factory=list) # Allowed channel IDs if allowlist
dm: SlackDMConfig = Field(default_factory=SlackDMConfig)
class ChannelsConfig(BaseModel):
"""Configuration for chat channels."""
whatsapp: WhatsAppConfig = Field(default_factory=WhatsAppConfig)
telegram: TelegramConfig = Field(default_factory=TelegramConfig)
slack: SlackConfig = Field(default_factory=SlackConfig)
class AgentDefaults(BaseModel):