Skip to content

Commit bcf19f2

Browse files
Banametaliksclaude
andcommitted
v2.1.0: AI Agent upgrade, multi-provider support, Telegram alerts, version sync
- Add multi-provider AI support (Anthropic, OpenAI, Ollama) via aiProviderService - Upgrade AI agent with 30+ tools, autonomous TODO creation, persistent memory - Add JarvisChat component for web dashboard AI chat - Wire Telegram alerts into deploys, PR create/merge, backups, upgrades - Add vpc ai terminal commands (ask, sql, summarize, providers) - Add desktop right-click copy/cut/paste - Fix VPC Sync version inconsistencies (now 8.0.0 everywhere) - Bump VPC OS version to 2.1.0 - Add one-line install script for Ubuntu/Debian VPS - Update README with AI Agent section and install instructions - Add migration 036 for ai_provider_commands table - Add encryption utility for secret management Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2bc9394 commit bcf19f2

26 files changed

Lines changed: 2771 additions & 560 deletions

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@
4040

4141
---
4242

43+
## Install
44+
45+
One command to install VPC on any Ubuntu/Debian VPS:
46+
47+
```bash
48+
curl -fsSL https://raw.githubusercontent.com/PATILYASHH/VPC/main/install.sh | sudo bash
49+
```
50+
51+
The installer will:
52+
- Install Node.js, PostgreSQL, Nginx, PM2
53+
- Ask for your admin username, email, and password
54+
- Optionally configure a domain with SSL
55+
- Start VPC and show you the access URL + credentials
56+
57+
---
58+
4359
## What is VPC?
4460

4561
VPC (Virtual PC Control) is a **web-based desktop environment** for managing your VPS. Instead of juggling terminals, dashboards, and tools — you get a single OS-like interface with windowed apps, a taskbar, and a launcher. Everything your server needs, in one place.
@@ -148,6 +164,21 @@ Monitor and control your server infrastructure.
148164

149165
<br />
150166

167+
### AI Agent (Jarvis)
168+
169+
An autonomous AI agent that lives on your server — thinks, diagnoses, and acts.
170+
171+
- Multi-provider support: **Anthropic Claude**, **OpenAI GPT**, **Ollama** (local)
172+
- 30+ built-in tools: deploy, restart, SQL, git, file ops, diagnostics
173+
- Autonomous task management with priority-based TODOs
174+
- Persistent memory across conversations
175+
- Telegram bot integration — chat with your server from your phone
176+
- Proactive alerts: deploy status, backup results, PR events, resource warnings
177+
- Approval workflow for dangerous operations (write files, run scripts)
178+
- Auto-diagnose issues: checks logs, services, disk, memory, DB health
179+
180+
<br />
181+
151182
### Security
152183

153184
- JWT authentication with TOTP (2FA) support
@@ -179,7 +210,7 @@ The **VPC Sync** extension brings VPSHub into your editor:
179210
| **Frontend** | React 18, Vite, TailwindCSS, Radix UI, Zustand, React Query |
180211
| **Backend** | Node.js, Express, PostgreSQL |
181212
| **Auth** | JWT, TOTP, bcrypt |
182-
| **AI** | Anthropic Claude (code review, PR analysis) |
213+
| **AI** | Anthropic Claude, OpenAI GPT, Ollama (multi-provider) |
183214
| **Process Manager** | PM2 |
184215
| **Reverse Proxy** | Nginx |
185216
| **Extension** | VS Code SCM Provider API |
@@ -362,7 +393,7 @@ VPC/
362393
│ ├── routes/ # API routes
363394
│ ├── services/ # Business logic
364395
│ ├── middleware/ # Auth, rate limiting, permissions
365-
│ ├── migrations/ # SQL migrations (001-035)
396+
│ ├── migrations/ # SQL migrations (001-036)
366397
│ └── db/ # Migration runner, admin seeder
367398
├── frontend/
368399
│ └── src/

app.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pool.query(`ALTER TABLE vpc_admins ADD COLUMN IF NOT EXISTS permissions JSONB DE
3636

3737
// Initialize web-hosting caches and start server
3838
const webHostingService = require('./backend/services/webHostingService');
39+
const jarvisTelegram = require('./backend/services/jarvisTelegramService');
3940

4041
app.listen(PORT, async () => {
4142
console.log(`[VPC] Server running on port ${PORT}`);
@@ -48,14 +49,13 @@ app.listen(PORT, async () => {
4849
console.error('[VPC] Failed to init web-hosting caches:', err.message);
4950
}
5051

51-
// Start Jarvis Telegram bot polling (if configured)
52+
// Start Telegram bot polling (if configured)
5253
try {
53-
const jarvisTelegram = require('./backend/services/jarvisTelegramService');
5454
const settingsRouter = require('./backend/routes/settings');
5555
await jarvisTelegram.init(pool, settingsRouter.decrypt);
56-
console.log('[VPC] Jarvis Telegram bot initialized');
56+
console.log('[VPC] Telegram bot initialized');
5757
} catch (err) {
58-
console.error('[VPC] Jarvis Telegram init failed:', err.message);
58+
console.error('[VPC] Telegram bot init failed:', err.message);
5959
}
6060

6161
// Auto-upgrade check every 5 hours
@@ -81,6 +81,7 @@ app.listen(PORT, async () => {
8181
}
8282

8383
const behindCount = parseInt(execSync(`git rev-list HEAD..origin/${branch} --count`, { cwd: rootDir, encoding: 'utf8' }).trim()) || 0;
84+
jarvisTelegram.alertUpgradeAvailable(behindCount).catch(() => {});
8485
console.log(`[VPC Auto-Upgrade] ${behindCount} new commits. Starting auto-upgrade...`);
8586

8687
const run = (cmd) => new Promise((resolve, reject) => {
@@ -157,12 +158,18 @@ app.listen(PORT, async () => {
157158
if (now - lastAt >= intervalMs) {
158159
console.log(`[VPC Auto-Backup] Running scheduled ${schedule.interval} backup for ${project[0].name}...`);
159160
const backupService = require('./backend/services/backupService');
160-
await backupService.runBackup(pool, {
161-
database: project[0].db_name,
162-
backupType: 'full',
163-
initiatedBy: null,
164-
notes: `Auto-backup (${schedule.interval})`,
165-
});
161+
try {
162+
await backupService.runBackup(pool, {
163+
database: project[0].db_name,
164+
backupType: 'full',
165+
initiatedBy: null,
166+
notes: `Auto-backup (${schedule.interval})`,
167+
});
168+
jarvisTelegram.alertBackupComplete(project[0].db_name).catch(() => {});
169+
} catch (backupErr) {
170+
jarvisTelegram.alertBackupFailed(project[0].db_name, backupErr.message).catch(() => {});
171+
throw backupErr;
172+
}
166173

167174
// Cleanup old backups beyond keepCount
168175
const keepCount = schedule.keepCount || 7;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- AI terminal commands
2+
INSERT INTO allowed_commands (command, description, category, risk_level) VALUES
3+
('vpc ai ask <question>', 'Ask AI a quick question', 'ai', 'low'),
4+
('vpc ai sql <description>', 'Generate SQL from natural language', 'ai', 'medium'),
5+
('vpc ai summarize logs', 'AI summary of recent logs', 'ai', 'low'),
6+
('vpc ai providers', 'List available AI providers', 'ai', 'low'),
7+
('vpc ai use <provider>', 'Set default AI provider', 'ai', 'low')
8+
ON CONFLICT (command) DO NOTHING;

backend/package-lock.json

Lines changed: 76 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@anthropic-ai/sdk": "^0.78.0",
13+
"@google/generative-ai": "^0.24.1",
1314
"bcryptjs": "^2.4.3",
1415
"cors": "^2.8.5",
1516
"csv-parser": "^3.0.0",
@@ -20,6 +21,7 @@
2021
"helmet": "^7.1.0",
2122
"jsonwebtoken": "^9.0.2",
2223
"multer": "^1.4.5-lts.1",
24+
"openai": "^6.33.0",
2325
"pg": "^8.12.0",
2426
"pm2": "^5.3.0",
2527
"qrcode": "^1.5.4",

0 commit comments

Comments
 (0)