openclaw/package.json
Arne Moor 69608fd305 feat: add telegram provider with CLI integration
Add Telegram as a third messaging provider alongside web and twilio.

Core Features:
- Interactive login flow with phone/SMS/2FA authentication
- Send text and media messages (images, videos, audio, documents)
- Monitor incoming messages with auto-reply support
- Session management at ~/.clawdis/telegram/session/
- Full CLI integration (login, logout, status, send, relay commands)

Implementation Details:
- Uses telegram npm package for MTProto API access
- Supports both URL and local file media sending
- Cross-platform path handling (Windows/Unix)
- Optional Twilio env vars (supports Telegram-only usage)
- Minimal provider abstraction pattern
- Comprehensive test coverage (440 tests passing)

Changes:
- Add Telegram module (client, login, monitor, inbound, outbound, session)
- Add provider factory and base interfaces
- Wire Telegram functions into CLI deps
- Update env validation to make Twilio fields optional
- Add telegram to all CLI commands (login, logout, status, send, relay)
- Add null checks in Twilio code for optional env fields
- Fix send command to properly load session and connect
- Add local file support with cross-platform path handling
- Update login message to show correct ~/.clawdis path
- Add comprehensive tests and documentation

Basic Usage:
  warelay login --provider telegram
  warelay send --provider telegram --to "@user" --message "Hi"
  warelay send --provider telegram --to "@user" --media "/path/to/file.jpg"
  warelay relay --provider telegram

All tests pass (63 files, 440 tests). Zero TypeScript errors.
2025-12-05 18:59:38 +01:00

84 lines
1.9 KiB
JSON

{
"name": "warelay",
"version": "1.4.0",
"description": "WhatsApp relay CLI (send, monitor, webhook, auto-reply) using Twilio",
"type": "module",
"main": "dist/index.js",
"bin": {
"warelay": "bin/warelay.js",
"warely": "bin/warelay.js",
"wa": "bin/warelay.js"
},
"scripts": {
"dev": "tsx src/index.ts",
"build": "tsc -p tsconfig.json",
"start": "tsx src/index.ts",
"warelay": "tsx src/index.ts",
"warely": "tsx src/index.ts",
"wa": "tsx src/index.ts",
"lint": "biome check src",
"lint:fix": "biome check --write --unsafe src && biome format --write src",
"format": "biome format src",
"format:fix": "biome format src --write",
"test": "vitest",
"test:coverage": "vitest run --coverage"
},
"keywords": [],
"author": "",
"license": "MIT",
"engines": {
"node": ">=22.0.0"
},
"packageManager": "pnpm@10.23.0",
"dependencies": {
"@whiskeysockets/baileys": "7.0.0-rc.9",
"body-parser": "^2.2.1",
"chalk": "^5.6.2",
"commander": "^14.0.2",
"dotenv": "^17.2.3",
"express": "^5.1.0",
"json5": "^2.2.3",
"pino": "^10.1.0",
"qrcode-terminal": "^0.12.0",
"sharp": "^0.33.5",
"telegram": "^2.26.22",
"twilio": "^5.10.6",
"zod": "^4.1.13"
},
"devDependencies": {
"@biomejs/biome": "^2.3.7",
"@types/body-parser": "^1.19.6",
"@types/express": "^5.0.5",
"@types/node": "^24.10.1",
"@types/qrcode-terminal": "^0.12.2",
"@vitest/coverage-v8": "^4.0.13",
"tsx": "^4.20.6",
"typescript": "^5.9.3",
"vitest": "^4.0.13"
},
"vitest": {
"coverage": {
"provider": "v8",
"reporter": [
"text",
"lcov"
],
"thresholds": {
"lines": 70,
"functions": 70,
"branches": 70,
"statements": 70
},
"include": [
"src/**/*.ts"
],
"exclude": [
"src/**/*.test.ts"
]
},
"exclude": [
"dist/**"
]
}
}