feat(telegram-gramjs): Phase 1 - User account adapter with tests and docs
Implements Telegram user account support via GramJS/MTProto (#937).
## What's New
- Complete GramJS channel adapter for user accounts (not bots)
- Interactive auth flow (phone → SMS → 2FA)
- Session persistence via StringSession
- DM and group message support
- Security policies (allowFrom, dmPolicy, groupPolicy)
- Multi-account configuration
## Files Added
### Core Implementation (src/telegram-gramjs/)
- auth.ts - Interactive authentication flow
- auth.test.ts - Auth flow tests (mocked)
- client.ts - GramJS TelegramClient wrapper
- config.ts - Config adapter for multi-account
- gateway.ts - Gateway adapter (poll/send)
- handlers.ts - Message conversion (GramJS → openclaw)
- handlers.test.ts - Message conversion tests
- setup.ts - CLI setup wizard
- types.ts - TypeScript type definitions
- index.ts - Module exports
### Configuration
- src/config/types.telegram-gramjs.ts - Config schema
### Plugin Extension
- extensions/telegram-gramjs/index.ts - Plugin registration
- extensions/telegram-gramjs/src/channel.ts - Channel plugin implementation
- extensions/telegram-gramjs/openclaw.plugin.json - Plugin manifest
- extensions/telegram-gramjs/package.json - Dependencies
### Documentation
- docs/channels/telegram-gramjs.md - Complete setup guide (14KB)
- GRAMJS-PHASE1-SUMMARY.md - Implementation summary
### Registry
- src/channels/registry.ts - Added telegram-gramjs to CHAT_CHANNEL_ORDER
## Test Coverage
- ✅ Auth flow with phone/SMS/2FA (mocked)
- ✅ Phone number validation
- ✅ Session verification
- ✅ Message conversion (DM, group, reply)
- ✅ Session key routing
- ✅ Command extraction
- ✅ Edge cases (empty messages, special chars)
## Features Implemented (Phase 1)
- ✅ User account authentication via MTProto
- ✅ DM message send/receive
- ✅ Group message send/receive
- ✅ Reply context preservation
- ✅ Security policies (pairing, allowlist)
- ✅ Multi-account support
- ✅ Session persistence
- ✅ Command detection
## Next Steps (Phase 2)
- Media support (photos, videos, files)
- Voice messages and stickers
- Message editing and deletion
- Reactions
- Channel messages
## Documentation Highlights
- Getting API credentials from my.telegram.org
- Interactive setup wizard walkthrough
- DM and group policies configuration
- Multi-account examples
- Rate limits and troubleshooting
- Security best practices
- Migration guide from Bot API
Closes #937 (Phase 1)