Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions agent/prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ def _strip_yaml_frontmatter(content: str) -> str:
"attachments, audio and video as file attachments. "
"Image URLs in markdown format ![alt](url) are rendered as inline previews automatically."
),
"rocketchat": (
"You are in a Rocket.Chat workspace communicating with your user. "
"Rocket.Chat renders standard Markdown — headings, bold, italic, code "
"blocks, tables, and links all work. "
"You can send media files natively: include MEDIA:/absolute/path/to/file "
"in your response. Images (.jpg, .png, .webp) are uploaded as photo "
"attachments, audio and video as file attachments. "
"Threaded replies work via the tmid field — when you reply to a "
"threaded message the client keeps the conversation grouped."
),
"matrix": (
"You are in a Matrix room communicating with your user. "
"Matrix renders Markdown — bold, italic, code blocks, and links work; "
Expand Down
4 changes: 3 additions & 1 deletion cron/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# in cron delivery targets, preventing env var enumeration via crafted names.
_KNOWN_DELIVERY_PLATFORMS = frozenset({
"telegram", "discord", "slack", "whatsapp", "signal",
"matrix", "mattermost", "homeassistant", "dingtalk", "feishu",
"matrix", "mattermost", "rocketchat", "homeassistant", "dingtalk", "feishu",
"wecom", "wecom_callback", "weixin", "sms", "email", "webhook", "bluebubbles",
"qqbot",
})
Expand All @@ -58,6 +58,7 @@
"slack": "SLACK_HOME_CHANNEL",
"signal": "SIGNAL_HOME_CHANNEL",
"mattermost": "MATTERMOST_HOME_CHANNEL",
"rocketchat": "ROCKETCHAT_HOME_CHANNEL",
"sms": "SMS_HOME_CHANNEL",
"email": "EMAIL_HOME_ADDRESS",
"dingtalk": "DINGTALK_HOME_CHANNEL",
Expand Down Expand Up @@ -296,6 +297,7 @@ def _deliver_result(job: dict, content: str, adapters=None, loop=None) -> Option
"signal": Platform.SIGNAL,
"matrix": Platform.MATRIX,
"mattermost": Platform.MATTERMOST,
"rocketchat": Platform.ROCKETCHAT,
"homeassistant": Platform.HOMEASSISTANT,
"dingtalk": Platform.DINGTALK,
"feishu": Platform.FEISHU,
Expand Down
25 changes: 25 additions & 0 deletions gateway/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Platform(Enum):
SLACK = "slack"
SIGNAL = "signal"
MATTERMOST = "mattermost"
ROCKETCHAT = "rocketchat"
MATRIX = "matrix"
HOMEASSISTANT = "homeassistant"
EMAIL = "email"
Expand Down Expand Up @@ -804,6 +805,7 @@ def _validate_gateway_config(config: "GatewayConfig") -> None:
Platform.DISCORD: "DISCORD_BOT_TOKEN",
Platform.SLACK: "SLACK_BOT_TOKEN",
Platform.MATTERMOST: "MATTERMOST_TOKEN",
Platform.ROCKETCHAT: "ROCKETCHAT_TOKEN",
Platform.MATRIX: "MATRIX_ACCESS_TOKEN",
Platform.WEIXIN: "WEIXIN_TOKEN",
}
Expand Down Expand Up @@ -963,6 +965,29 @@ def _apply_env_overrides(config: GatewayConfig) -> None:
name=os.getenv("MATTERMOST_HOME_CHANNEL_NAME", "Home"),
)

# Rocket.Chat
rocketchat_token = os.getenv("ROCKETCHAT_TOKEN")
if rocketchat_token:
rocketchat_url = os.getenv("ROCKETCHAT_URL", "")
rocketchat_user_id = os.getenv("ROCKETCHAT_USER_ID", "")
if not rocketchat_url:
logger.warning("ROCKETCHAT_TOKEN set but ROCKETCHAT_URL is missing")
if not rocketchat_user_id:
logger.warning("ROCKETCHAT_TOKEN set but ROCKETCHAT_USER_ID is missing")
if Platform.ROCKETCHAT not in config.platforms:
config.platforms[Platform.ROCKETCHAT] = PlatformConfig()
config.platforms[Platform.ROCKETCHAT].enabled = True
config.platforms[Platform.ROCKETCHAT].token = rocketchat_token
config.platforms[Platform.ROCKETCHAT].extra["url"] = rocketchat_url
config.platforms[Platform.ROCKETCHAT].extra["user_id"] = rocketchat_user_id
rocketchat_home = os.getenv("ROCKETCHAT_HOME_CHANNEL")
if rocketchat_home and Platform.ROCKETCHAT in config.platforms:
config.platforms[Platform.ROCKETCHAT].home_channel = HomeChannel(
platform=Platform.ROCKETCHAT,
chat_id=rocketchat_home,
name=os.getenv("ROCKETCHAT_HOME_CHANNEL_NAME", "Home"),
)

# Matrix
matrix_token = os.getenv("MATRIX_ACCESS_TOKEN")
matrix_homeserver = os.getenv("MATRIX_HOMESERVER", "")
Expand Down
Loading