Send messages (text, image, file) to external channels (Telegram, Discord, etc.) through the Gateway system.

## Operations

### status — Gateway status
Returns system status, connections, sessions, subscriptions, and uptime.

### sessions — List active sessions
- operation="sessions"
- limit: Max sessions to return (default: 50)
- offset: Pagination offset (default: 0)
- type: Filter by "private", "group", or "all" (default: "all")

### contacts — List contacts for a platform
- operation="contacts"
- platform: Platform name (e.g., "telegram", "discord")

### send — Send message
- operation="send"
- content: Message content (required)
- contactUid: Contact UID "telegram:123456789" (private chat only!)
- sessionId: Session ID (for private and group chats)
- messageType: "text", "image", or "file" (default: "text")

## Sending Messages

### Private Chat
Use contactUid to send direct messages:
```
gateway(operation="send" contactUid="telegram:123456789" content="Hello!")
```

### Group Chat
Use sessionId to send to groups:
```
gateway(operation="send" sessionId="telegram_telegram-main_-100123456_123456" content="Hello group!")
```

## Session Filtering

Sessions include chat type (private/group) and title:
```
# List private chats only
gateway(operation="sessions" type="private")

# List groups only
gateway(operation="sessions" type="group")

# List all
gateway(operation="sessions" type="all")
```

## Quick Reference

| Parameter | Target | Description |
|-----------|--------|-------------|
| contactUid | Private Chat | Direct message to user |
| sessionId | Private/Group | Message via session |

## Message Types

| Type | Description | Status |
|------|-------------|--------|
| text | Plain text | ✅ Supported |
| image | Image URL or file path | ✅ Supported |
| file | File URL or path | ✅ Supported |

## Examples

```
# Status
gateway(operation="status")

# Channels
gateway(operation="channels")

# Sessions (all)
gateway(operation="sessions")

# Sessions - filter by type
gateway(operation="sessions" type="private")
gateway(operation="sessions" type="group")

# Contacts
gateway(operation="contacts" platform="telegram")

# Send - contactUid (private chat)
gateway(operation="send" contactUid="telegram:123456789" content="Hello!")
gateway(operation="send" contactUid="telegram:123456789" content="https://example.com/photo.jpg" messageType="image")
gateway(operation="send" contactUid="telegram:123456789" content="file:///path/to/document.pdf" messageType="file")

# Send - sessionId (group chat)
gateway(operation="send" sessionId="telegram_telegram-main_-100123456_123456" content="Hello group!")
gateway(operation="send" sessionId="telegram_telegram-main_-100123456_123456" content="https://example.com/file.pdf" messageType="file")
gateway(operation="send" sessionId="telegram_telegram-main_-100123456_123456" content="file:///path/to/photo.jpg" messageType="image")
```

## Error Handling

- Missing content: "content is required"
- No contactUid/sessionId: Helpful error message
- Gateway unavailable: "Cannot connect to Gateway server"

## Platform Support

telegram, discord, slack, feishu, wechat, signal, nostr, webchat
