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-
Core framework
7 files changed
session.pyCore session abstraction for managing BBS connectionssession_manager.pySession manager for lifecycle management of multiple sessionsgeneric_io.pyGeneric IO base for transport-level communicationtelnet.pyTelnet transport with IAC negotiation__init__.pyTerminal emulator with ANSI escape sequence handling and screen bufferserver.pyMCP server with BBS tool registration (bbs_connect, bbs_send, bbs_read, bbs_screenshot)cli.pyCLI entry point with command routing
- Added telnet transport layer with IAC negotiation, SSH transport stub, and base transport abstraction
instantiate
architectural
2 files
telnet.pysession.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.pysession_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.pyLearning engine loading rules from games/{namespace}/rules.jsondetector.pyPrompt detection with regex pattern matchingbuffer.pyScreen buffer for capturing BBS screens during sessionsextractor.pyKnowledge extraction pipelinerules.jsonTW2002 prompt detection rules with negative_match support
- Implemented prompt detection system using JSON-based rules with regex pattern matching
instantiate
behavioral
2 files
detector.pyrules.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.pyknowledge.py
- Rules loaded from
games/{namespace}/rules.jsonwith support for negative_match patterns instantiate internal2 files
engine.pyrules.json
Trade Wars 2002 game support
5 files changed
bot.pyFull TW2002 bot with login flow, trading, combat, banking, colonizationlogin.pyLogin state machine with multi-stage prompt handlingorientation.pyThree-layer orientation system (screen parsing, knowledge base, detection heuristics)profitable_pairs.pyProfitable pairs trading strategycharacter.pyMulti-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.pylogin.pyorientation.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.pyopportunistic.py
- Multi-character support with character creation, identity store, and account pool
instantiate
internal
2 files
character.pymulti_character.py
- Data mapper for structured game data extraction
instantiate
internal
1 file
data_mapper.py
AI/LLM integration
2 files changed
__init__.pyLLM abstraction layer with provider selectionai_strategy.pyAI 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__.pySwarm manager for running multiple bot instances simultaneouslycli_swarm.pySwarm CLI interfaceapp.pyTUI 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.pyapp.py
- Watch system with event broker for real-time bot monitoring
instantiate
behavioral
1 file
__init__.py
Web dashboard
3 files changed
dashboard.htmlFull HTML/JS dashboard for monitoring bot swarm statusdashboard.jsReal-time dashboard updates via server-sent events__init__.pyAPI routes for swarm management, terminal access, and log viewing
- Full HTML/JS dashboard for monitoring bot swarm status
instantiate
behavioral
2 files
dashboard.htmldashboard.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__.pylog_routes.py
Infrastructure
4 files changed
pyproject.tomlProject setup with dependencies and package configurationMakefileBuild and development targetsci.ymlCI workflowARCHITECTURE_DIAGRAM.mdArchitecture overview and diagrams
- Project setup with pyproject.toml, Makefile, uv.lock
baseline
internal
2 files
pyproject.tomlMakefile
- 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.mdSYSTEM_ARCHITECTURE.md