File size: 7,855 Bytes
3e20e94
e35b2a1
3e20e94
 
1d59ffd
 
 
 
3e20e94
 
 
 
 
e35b2a1
3e20e94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e35b2a1
 
 
 
 
 
 
3e20e94
e35b2a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
---
license: agpl-3.0
tags:
- snapkitty
- agents
- ada
- lean4
- prolog
---
# BOB IDE β€” Sovereign Development Environment

**Full-featured IDE with real terminal, code execution, and artifact management.**

[![License](https://img.shields.io/badge/License-AGPL--3.0-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

Licensed under **AGPL-3.0**. Full text: [LICENSE](LICENSE).

Releases published before 2026-10-07 were licensed under MIT; copies obtained under those terms keep them.

### πŸ’Ό Commercial License

SnapKitty code is free and open under **AGPL-3.0** for open-source use. Building a commercial product or service? A **proprietary commercial license** from Snapkitty Collective LLC lets you ship this code without the AGPL's source-sharing and network-use obligations.

**[β†’ Get a commercial license](mailto:A.parr@belespritdaccord.uk?subject=Commercial%20license:%20bob-ide)** Β· A.parr@belespritdaccord.uk