πŸ—οΈ MSV Router Architecture

MeuSecretΓ‘rioVirtual β€” Container Provisioning Flow

ENTRY POINTS
message-handler.js
  • Text messages
  • [FIRST_INTERACTION] prefix
bot.js
  • Voice, photos, documents
  • Inline callbacks
↓ Both call containerManager.*
β–Ό
container-manager.js (896 lines)
βœ… PRODUCTION
  • getValidatedContainerPort()
  • provisionAgentAsync() β†’
  • resetValidationCache()
  • allocatePort()
  • storeContainerPort()
πŸ§ͺ TESTS ONLY
  • provisionAgent()
  • provisionAgentWithRetry()
  • spawnContainer() (sync)

⚠️ Same templates via ./templates

β–Ό

πŸš€ ACTUAL PRODUCTION CODE

  • Runs in Worker thread (non-blocking)
  • spawnContainer() ← production version
  • waitForHealthy(), installProactiveAmcp()
  • Imports from ./templates
β–Ό
templates/ β€” 🎯 SINGLE SOURCE OF TRUTH

✨ Edit here β†’ changes apply to tests AND production

πŸ“ DETERMINISTIC VOLUME NAMING

Container: msv-agent-{telegramId}

Data dir: /opt/msv/data/{telegramId}/

/opt/msv/data/{telegramId}/
β”œβ”€β”€ config/openclaw.json  β†’ container config
β”œβ”€β”€ workspace/            β†’ AGENTS.md, MEMORY.md, etc
β”œβ”€β”€ sessions/             β†’ conversation history
β”œβ”€β”€ media/                β†’ images, voice, files
└── amcp/                 β†’ agent identity

πŸ” Find user: ls /opt/msv/data/{TELEGRAM_ID}/

Entry Points
Production Path
Tests Only
Single Source of Truth