✅ What's Working: - WebSocket connections established (patched worker to intercept upgrades) - Real-time event streaming: Agent → DO → Browser - Terminal panel showing live command execution - Agent chat panel showing LLM thoughts - Full infrastructure: UI → API → DO → SSH Proxy → LangGraph Agent 🔧 Key Changes: - Created standalone DO worker at workers/bandit-agent-do/ - Deployed DO as separate Worker (bandit-agent-do) - Updated wrangler.jsonc to reference external DO via script_name - Modified patch-worker.js to intercept WS upgrades before Next.js - Added __name polyfill to fix esbuild helper - Created pnpm workspace config for monorepo 📝 Architecture: - Frontend (Next.js) → Cloudflare Worker - Worker intercepts /api/agent/*/ws → forwards to DO - DO (bandit-agent-do) → manages WebSocket connections - DO → calls SSH Proxy API - SSH Proxy → runs LangGraph agent → executes SSH commands - Events stream back: SSH Proxy → DO → WebSocket → UI 🐛 Known Issue: - Agent logic needs refinement (not parsing SSH output correctly) - But core infrastructure is 100% functional! This resolves all WebSocket and real-time streaming issues.
20 lines
407 B
TOML
20 lines
407 B
TOML
name = "bandit-agent-do"
|
|
main = "src/index.ts"
|
|
compatibility_date = "2024-01-01"
|
|
account_id = "a19f770b9be1b20e78b8d25bdcfd3bbd"
|
|
|
|
[durable_objects]
|
|
bindings = [
|
|
{ name = "BANDIT_AGENT", class_name = "BanditAgentDO" }
|
|
]
|
|
|
|
[[migrations]]
|
|
tag = "v1"
|
|
new_sqlite_classes = ["BanditAgentDO"]
|
|
|
|
[vars]
|
|
SSH_PROXY_URL = "https://bandit-ssh-proxy.fly.dev"
|
|
MAX_RUN_DURATION_MINUTES = "60"
|
|
MAX_RETRIES_PER_LEVEL = "3"
|
|
|