How appback/remoteagent works
RemoteAgent is a self-hosted runtime for continuing local coding sessions from Telegram, with terminal control and an optional Mini App. The principal workflow is owner message → Telegram bot → bridge/session orchestration → Codex or Claude adapter → local provider process, with session state persisted locally and results returned through Telegram. The graph also includes documented attachment intake, memory, Jev review, bot management, and session dispatch. Some connections are based on README or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: bot.ts Telegram Bot · bridge-service.ts Session Bridge · index.ts Runtime Startup · codex-adapter.ts Codex Adapter
Components 23
User Interfaces
- Telegram Bot
src/bot.ts - Terminal CLI
src/cli.ts - Mini App UI
src/services/local-ui-service.ts
Session Runtime
- Runtime Startup
src/index.ts - Session Bridge
src/services/bridge-service.ts - Session Dispatch
src/services/session-dispatch-service.ts
Provider Execution
- Codex Adapter
src/adapters/codex-adapter.ts - Claude Adapter
src/adapters/claude-adapter.ts - Process Runner
src/adapters/windows-shell.ts - Provider Environment
src/adapters/runtime-env.ts
Runtime Services
- Attachment Intake
src/services/telegram-upload.ts - Session Memory
src/services/agent-memory-service.ts - Jev Review
src/services/jev-service.ts - Remote Shell
src/services/remote-shell-service.ts - Bot Management
src/services/bot-management-service.ts - Polling State
src/services/bot-polling-state-service.ts - Provider Setup
src/services/provider-setup-service.ts - Login Service
src/services/login-service.ts - Peer Bots
src/services/peer-service.ts
Local State
- Session Store
src/store/file-store.ts - Runtime Config
src/config.ts
Other components
- Owner
- Telegram
Connections 30
- Owner → Telegram: messages
- Telegram → Telegram Bot: updates
- Owner → Terminal CLI: controls
- Telegram Bot → Session Bridge: routes session work
src/bot.ts - Runtime Startup → Telegram Bot: starts
src/index.ts - Runtime Startup → Session Bridge: constructs
src/index.ts - Runtime Startup → Session Store: constructs
src/index.ts - Runtime Startup → Codex Adapter: configures
src/index.ts - Runtime Startup → Claude Adapter: configures
src/index.ts - Session Bridge → Session Store: reads and writes
src/services/bridge-service.ts - Session Bridge → Codex Adapter: executes requests
src/services/bridge-service.ts - Session Bridge → Claude Adapter: executes requests
- Codex Adapter → Process Runner: spawns process
src/adapters/codex-adapter.ts - Claude Adapter → Process Runner: spawns process
src/adapters/claude-adapter.ts - Process Runner → Provider Environment: builds environment
src/adapters/windows-shell.ts - Session Bridge → Session Dispatch: delegates dispatch
src/services/bridge-service.ts - Telegram Bot → Attachment Intake: runs upload
src/bot.ts - Telegram Bot → Session Memory: uses session memory
src/bot.ts - Telegram Bot → Jev Review: invokes review
src/bot.ts - Telegram Bot → Remote Shell: handles shell commands
src/bot.ts - Telegram Bot → Bot Management: manages bots
src/bot.ts - Bot Management → Polling State: reads polling state
src/services/bot-management-service.ts - Telegram Bot → Provider Setup: handles setup
src/bot.ts - Telegram Bot → Login Service: handles login
src/bot.ts - Telegram Bot → Peer Bots: handles peer commands
src/bot.ts - Telegram Bot → Runtime Config: uses configuration
src/bot.ts - Terminal CLI → Runtime Startup: launches runtime
src/cli.ts - Telegram → Mini App UI: opens optional UI
- Mini App UI → Session Bridge: controls same sessions
src/services/local-ui-service.ts - Telegram Bot → Telegram: sends results