Commit Graph

3 Commits

Author SHA1 Message Date
Arne Moor
1f959a188f chore: apply biome formatting
Applied formatting fixes to 21 files:
- Fixed import ordering
- Normalized indentation
- Wrapped long lines

No logic changes, formatting only.
2025-12-06 18:45:25 +01:00
Arne Moor
08bede3a0b fix: align console logs in multi-provider mode
Suppress individual provider startup messages when running in
multi-provider mode to avoid duplicate/conflicting console output.
The multi-relay orchestrator provides unified startup messaging.

Changes:
- Add suppressStartMessage to WebMonitorTuning type
- Update monitorWebProvider to suppress startup message when flag set
- Update Telegram monitor to suppress initial "Starting..." message
- Pass suppressStartMessage: true from multi-relay to both providers

Console output before:
  📡 Starting 2 provider(s): web, telegram
  📡 Starting Telegram relay...
  📡 Listening for personal WhatsApp Web inbound messages. Leave this running; Ctrl+C to stop.
   All 2 provider(s) active. Listening for messages... (Ctrl+C to stop)

Console output after:
  📡 Starting 2 provider(s): web, telegram
   All 2 provider(s) active. Listening for messages... (Ctrl+C to stop)
2025-12-05 23:39:24 +01:00
Arne Moor
15a4631a97 feat: add multi-provider concurrent relay support
Implement --providers option to run multiple messaging providers
simultaneously in a single relay command. This enables seamless
session sharing across WhatsApp, Telegram, and Twilio.

Changes:
- Add src/cli/multi-relay.ts: Core multi-provider orchestration
  - Concurrent provider execution with Promise.allSettled
  - Graceful shutdown handling with AbortController
  - Unified startup and shutdown messaging
  - Per-provider error isolation

- Add selectProviders() to src/web/session.ts
  - Validates provider authentication before starting
  - Expands "auto" to all authenticated providers
  - User-friendly error messages for missing auth

- Update src/cli/program.ts relay command
  - Add --providers option (comma-separated list)
  - Refactor to build webTuning before multi-provider check
  - Pass suppressStartMessage=true to prevent duplicate logs

- Fix src/config/sessions.test.ts
  - Update tests to await async deriveSessionKey()

Tests:
- Add 11 new tests in src/cli/multi-relay.test.ts
  - Provider startup and shutdown
  - Concurrent execution
  - SIGINT handling
  - Error isolation
  - Console log alignment
- All 480 tests passing

Usage:
  warelay relay --providers web,telegram
  warelay relay --providers auto --verbose
2025-12-05 23:26:30 +01:00