nicholai acd04dd6ac 🎉 BREAKTHROUGH: WebSocket working! Real-time streaming functional
 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.
2025-10-09 15:10:16 -06:00

74 lines
2.3 KiB
JSON

{
"name": "bandit-runner-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
"deploy": "pnpm --filter bandit-agent-do deploy && opennextjs-cloudflare build && node scripts/patch-worker.js && opennextjs-cloudflare deploy",
"preview": "opennextjs-cloudflare build && node scripts/patch-worker.js && opennextjs-cloudflare preview",
"cf-typegen": "wrangler types --env-interface CloudflareEnv ./cloudflare-env.d.ts"
},
"dependencies": {
"@icons-pack/react-simple-icons": "^13.8.0",
"@langchain/core": "^0.3.78",
"@langchain/langgraph": "^0.4.9",
"@langchain/openai": "^0.6.14",
"@opennextjs/cloudflare": "^1.3.0",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-scroll-area": "^1.2.10",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slider": "^1.3.6",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-use-controllable-state": "^1.2.2",
"ai": "^5.0.62",
"ansi-to-html": "^0.7.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"harden-react-markdown": "^1.1.2",
"katex": "^0.16.23",
"lucide-react": "^0.545.0",
"next": "15.4.6",
"next-themes": "^0.4.6",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-markdown": "^10.1.0",
"react-syntax-highlighter": "^15.6.6",
"rehype-katex": "^7.0.1",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"shiki": "^3.13.0",
"sonner": "^2.0.7",
"tailwind-merge": "^3.3.1",
"use-stick-to-bottom": "^1.1.1",
"zod": "^4.1.12"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20251008.0",
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/node": "^20.19.19",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/react-syntax-highlighter": "^15.5.13",
"esbuild": "^0.25.10",
"eslint": "^9",
"eslint-config-next": "15.4.6",
"tailwindcss": "^4",
"tw-animate-css": "^1.4.0",
"typescript": "^5",
"wrangler": "^4.42.1"
}
}