bbsbot 2026-02-02
Initial commit of the MCP-BBS bbsbot framework with telnet transport, learning engine, TW2002 support, and web dashboard
659 files · 121,960+ · 3,368-
7 files changed
  • session.py Core session abstraction for managing BBS connections
  • session_manager.py Session manager for lifecycle management of multiple sessions
  • generic_io.py Generic IO base for transport-level communication
  • telnet.py Telnet transport with IAC negotiation
  • __init__.py Terminal emulator with ANSI escape sequence handling and screen buffer
  • server.py MCP server with BBS tool registration (bbs_connect, bbs_send, bbs_read, bbs_screenshot)
  • cli.py CLI entry point with command routing
  • Added telnet transport layer with IAC negotiation, SSH transport stub, and base transport abstraction instantiate architectural
    2 files
    • telnet.py
    • session.py
  • Implemented terminal emulator with ANSI escape sequence handling and screen buffer instantiate internal
    1 file
    • __init__.py
  • Created session management system with session lifecycle, keepalive, and replay capabilities instantiate internal
    2 files
    • session.py
    • session_manager.py
  • Added MCP server with BBS tool registration (bbs_connect, bbs_send, bbs_read, bbs_screenshot) interface behavioral
    1 file
    • server.py
  • Built CLI entry point with command routing instantiate behavioral
    1 file
    • cli.py

Learning engine

5 files changed
  • engine.py Learning engine loading rules from games/{namespace}/rules.json
  • detector.py Prompt detection with regex pattern matching
  • buffer.py Screen buffer for capturing BBS screens during sessions
  • extractor.py Knowledge extraction pipeline
  • rules.json TW2002 prompt detection rules with negative_match support
  • Implemented prompt detection system using JSON-based rules with regex pattern matching instantiate behavioral
    2 files
    • detector.py
    • rules.json
  • Added screen saver for capturing BBS screens during sessions instantiate internal
    1 file
    • buffer.py
  • Created knowledge extraction pipeline (buffer, detector, extractor, rules, discovery) instantiate internal
    2 files
    • extractor.py
    • knowledge.py
  • Rules loaded from games/{namespace}/rules.json with support for negative_match patterns instantiate internal
    2 files
    • engine.py
    • rules.json

Trade Wars 2002 game support

5 files changed
  • bot.py Full TW2002 bot with login flow, trading, combat, banking, colonization
  • login.py Login state machine with multi-stage prompt handling
  • orientation.py Three-layer orientation system (screen parsing, knowledge base, detection heuristics)
  • profitable_pairs.py Profitable pairs trading strategy
  • character.py Multi-character support with character creation and identity store
  • Full TW2002 bot implementation with login flow, orientation system, trading, combat, banking, colonization, and upgrades instantiate behavioral
    3 files
    • bot.py
    • login.py
    • orientation.py
  • Three-layer orientation system (screen parsing, knowledge base, detection heuristics) instantiate internal
    1 file
    • orientation.py
  • Multiple trading strategies: opportunistic, profitable_pairs, twerk_optimized, and AI-powered strategy instantiate internal
    2 files
    • profitable_pairs.py
    • opportunistic.py
  • Multi-character support with character creation, identity store, and account pool instantiate internal
    2 files
    • character.py
    • multi_character.py
  • Data mapper for structured game data extraction instantiate internal
    1 file
    • data_mapper.py

AI/LLM integration

2 files changed
  • __init__.py LLM abstraction layer with provider selection
  • ai_strategy.py AI strategy with decision maker, feedback loop, goal tracking, and action validation
  • LLM abstraction layer supporting Ollama, OpenAI, and Gemini providers instantiate behavioral
    1 file
    • __init__.py
  • Response caching, retry logic, and usage tracking harden behavioral
    1 file
    • __init__.py
  • AI strategy with decision maker, feedback loop, goal tracking, and action validation instantiate internal
    1 file
    • ai_strategy.py
  • Intervention system with anomaly detection and opportunity detection instantiate internal
    1 file
    • detector.py

Swarm operations

3 files changed
  • __init__.py Swarm manager for running multiple bot instances simultaneously
  • cli_swarm.py Swarm CLI interface
  • app.py TUI monitor for real-time bot monitoring
  • Swarm manager for running multiple bot instances simultaneously instantiate behavioral
    1 file
    • __init__.py
  • Worker process management with configurable bot configs (35 demo bot configs included) instantiate internal
    1 file
    • cli_swarm.py
  • Swarm CLI and TUI monitor interfaces instantiate behavioral
    2 files
    • cli_swarm.py
    • app.py
  • Watch system with event broker for real-time bot monitoring instantiate behavioral
    1 file
    • __init__.py

Web dashboard

3 files changed
  • dashboard.html Full HTML/JS dashboard for monitoring bot swarm status
  • dashboard.js Real-time dashboard updates via server-sent events
  • __init__.py API routes for swarm management, terminal access, and log viewing
  • Full HTML/JS dashboard for monitoring bot swarm status instantiate behavioral
    2 files
    • dashboard.html
    • dashboard.js
  • Real-time updates via server-sent events instantiate internal
    1 file
    • dashboard.js
  • API routes for swarm management, terminal access, and log viewing interface behavioral
    2 files
    • __init__.py
    • log_routes.py

Infrastructure

4 files changed
  • pyproject.toml Project setup with dependencies and package configuration
  • Makefile Build and development targets
  • ci.yml CI workflow
  • ARCHITECTURE_DIAGRAM.md Architecture overview and diagrams
  • Project setup with pyproject.toml, Makefile, uv.lock baseline internal
    2 files
    • pyproject.toml
    • Makefile
  • Comprehensive test suite across all modules qualify internal
    1 file
    • ci.yml
  • Documentation including architecture diagrams, quick start guide, and game-specific docs specify internal
    2 files
    • ARCHITECTURE_DIAGRAM.md
    • SYSTEM_ARCHITECTURE.md