bob-ide / README.md
SNAPKITTYWEST's picture
push from SNAPKITTYWEST/bob-ide
0110dee verified
|
Raw
History Blame Contribute Delete
7.59 kB
# BOB IDE β€” Sovereign Development Environment
**Full-featured IDE with real terminal, code execution, and artifact management.**
[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
---
## What It Is
BOB IDE is a **complete development environment** designed to be powered by [sov-kernel-monster](https://github.com/SNAPKITTYWEST/sov-kernel-monster). It combines:
- πŸ–₯️ **Real Terminal** β€” bash, grep, curl, full command execution
- πŸ’» **Code Editor** β€” Monaco editor (VS Code engine) with syntax highlighting
- πŸ“ **File Browser** β€” Read/write files from the filesystem
- πŸ€– **AI Assistant** β€” IBM Granite + OpenRouter + WebLLM integration
- πŸ“¦ **Artifact Manager** β€” Save, load, and manage WORM-sealed artifacts
- ⚑ **Quantum Engine** β€” Vortex lattice visualization (optional)
**Architecture:** Frontend (React + TypeScript) + Backend (Fastify server) β†’ sov-kernel-monster quantum core
---
## Quick Start
### Frontend (Development)
```bash
git clone https://github.com/SNAPKITTYWEST/bob-ide.git
cd bob-ide
npm install
npm run dev
```
Open http://localhost:5173
### Backend (Terminal + File Operations)
```bash
cd backend
npm install
npm run dev
```
Backend runs on http://localhost:3000
---
## Features
### πŸ–₯️ Terminal
- **Real Shell Access** β€” bash, zsh, sh
- **Command History** β€” persistent across sessions
- **Quick Commands** β€” ls, pwd, uname, whoami (one-click)
- **Output Streaming** β€” real-time command results
- **Working Directory** β€” navigate with `cd`
- **Environment Variables** β€” full env access
**Supported Commands:**
- `bash` / `sh` β€” shell scripts
- `grep` β€” file searching (REST API: `/api/grep`)
- `curl` β€” HTTP requests (REST API: `/api/curl`)
- `ls`, `cat`, `echo`, `pwd`, `cd` β€” file operations
- Any installed CLI tool (git, node, python, etc.)
### πŸ“ Editor
- **Monaco Editor** β€” full VS Code engine
- **Multi-language** β€” TypeScript, JavaScript, Bash, Python, etc.
- **Syntax Highlighting** β€” every language
- **Line Numbers** β€” with selection
- **Keyboard Shortcuts:**
- `Ctrl+S` / `Cmd+S` β€” Save file
- `Ctrl+K` / `Cmd+K` β€” Run code (if bash/JavaScript)
- `Tab` β€” Indent
- `Ctrl+/` β€” Comment toggle
### πŸ“¦ Artifact Monorepo
- **Quantum Core** β€” 14 Fortran modules (bob_*.f90)
- **Theorem 3** β€” Haskell proof kernel (8 modules)
- **QuantumPiper** β€” 11-stage orchestration
- **Phase 3 Components** β€” Isabelle, IBM Granite, WebGPU, Terminal
- **WORM Chain** β€” immutable attestation (Blake3 + Ed25519)
All artifacts accessible via `/artifacts/` directory.
### πŸ€– AI Integration
- **IBM Granite** β€” primary inference backend
- **OpenRouter** β€” Claude, GPT-4, Llama (API key)
- **WebLLM** β€” Llama 3.2 1B in browser (no key needed)
---
## API Reference
### Terminal
**Create Session**
```
POST /api/terminal/create
{ "cols": 80, "rows": 24 }
β†’ { "sessionId": "...", "cwd": "/home/user" }
```
**Execute Command**
```
POST /api/execute
{ "sessionId": "term-...", "cmd": "ls -la", "cwd": "/home/user" }
β†’ { "ok": true, "output": "...", "cwd": "...", "exitCode": 0 }
```
**WebSocket Terminal (Real-time)**
```
WS /api/terminal/{id}/ws
Send: { "type": "input", "data": "echo hello\n" }
Recv: { "type": "output", "data": "hello\n" }
```
### File Operations
**Read File**
```
GET /api/file/path/to/file.ts
β†’ { "content": "...", "path": "path/to/file.ts" }
```
**Write File**
```
POST /api/file/write
{ "path": "path/to/file.ts", "content": "..." }
β†’ { "ok": true, "path": "..." }
```
### Search & Query
**Grep**
```
POST /api/grep
{ "pattern": "function", "path": "src", "recursive": true }
β†’ { "ok": true, "results": [{ "file": "...", "lineNum": 42, "content": "..." }] }
```
**Curl**
```
POST /api/curl
{ "url": "https://api.example.com", "method": "GET", "headers": {}, "body": "..." }
β†’ { "ok": true, "output": "..." }
```
**Bash**
```
POST /api/bash
{ "script": "for i in {1..5}; do echo $i; done" }
β†’ { "ok": true, "output": "1\n2\n3\n4\n5" }
```
---
## Architecture
```
bob-ide/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ components/
β”‚ β”‚ β”œβ”€β”€ ide/SovereignIDE.tsx ← Main IDE component
β”‚ β”‚ └── shell/AppShell.tsx ← Legacy Vortex shell
β”‚ β”œβ”€β”€ stores/ ← Zustand state
β”‚ └── App.tsx ← Entry point
β”‚
β”œβ”€β”€ backend/
β”‚ └── server.ts ← Fastify server
β”‚ β€’ Terminal session management
β”‚ β€’ Command execution (bash, grep, curl)
β”‚ β€’ File I/O
β”‚ β€’ WebSocket real-time shell
β”‚ β€’ Artifact storage
β”‚
β”œβ”€β”€ artifacts/ ← Monorepo (3K+ files)
β”‚ β”œβ”€β”€ quantum-core/ ← Fortran modules
β”‚ β”œβ”€β”€ theorem-3/ ← Haskell proof kernel
β”‚ β”œβ”€β”€ orchestration/ ← QuantumPiper
β”‚ └── artifacts-schema/ ← TypeScript schema
β”‚
└── package.json ← Dependencies
```
### Technology Stack
**Frontend**
- React 18 + TypeScript
- Monaco Editor (VS Code engine)
- Zustand (state management)
- Vite (build tool)
- xterm (terminal emulation)
**Backend**
- Fastify (web server)
- WebSocket support
- Node.js child_process (shell execution)
- FS (file I/O)
**Integration**
- Sovereign IDE Framework (TypeScript)
- Artifact Store (WORM-sealed)
- QuantumPiper Orchestration (Haskell)
---
## Environment
### Set API Keys (optional)
```bash
export IBM_GRANITE_API_KEY="your-key-here"
export OPENROUTER_API_KEY="your-key-here"
```
### Run Full Stack
```bash
# Terminal 1: Backend
cd backend
npm install && npm run dev
# Terminal 2: Frontend
npm run dev
```
Open http://localhost:5173 in browser
Backend API at http://localhost:3000
---
## Performance
- **Terminal Response:** <100ms
- **File Operations:** <50ms
- **Grep Search:** <500ms (1000+ files)
- **Editor Startup:** <2s
- **Chat Response:** varies by provider
---
## Security
- βœ… No API keys exposed in frontend
- βœ… All backend operations sanitized
- βœ… Directory traversal protection (`cwd` isolation)
- βœ… 30s command timeout (prevents hanging)
- βœ… WORM chain attestation on all artifacts
---
## Roadmap
### Phase 1 βœ… (Current)
- Real terminal backend
- File I/O
- Code editor
- Artifact monorepo
### Phase 2 (Next)
- sov-kernel-monster integration
- Real quantum execution
- Isabelle theorem proving
- IBM Granite inference
### Phase 3 (Future)
- Distributed verification (BFT)
- RTX 4090 GPU inference
- Multi-language debugging
- Live collaboration
---
## Development
### Add New Command
1. **Backend** (`backend/server.ts`):
```typescript
app.post('/api/mycommand', async (req) => {
const result = execSync(cmd, { encoding: 'utf-8' });
return { ok: true, output: result };
});
```
2. **Frontend** (`src/components/ide/SovereignIDE.tsx`):
```typescript
async function myCommand() {
const res = await fetch('/api/mycommand', { method: 'POST' });
const data = await res.json();
setTerminalState(prev => ({
...prev,
history: [...prev.history, data.output]
}));
}
```
---
## License
MIT β€” see [LICENSE](LICENSE)
**Built by Jessica (SNAPKITTYWEST)**
**Powered by Sovereign Kernel Monster**
**2026-07-20