diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 0000000..04b5666 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,265 @@ +# Building Antigravity from Source + +This guide explains how to extract, modify, and rebuild the Antigravity IDE from source. + +## Prerequisites + +- Linux system (Ubuntu/Debian recommended) +- Node.js 18+ with npm +- Git +- Standard build tools +- ~1GB disk space + +## Quick Build + +If you just want to rebuild the package without modifications: + +```bash +# Clone repository +git clone https://github.rommark.dev/admin/antigravity-ai-providers.git +cd antigravity-ai-providers + +# Build .deb package +./scripts/build-deb.sh + +# Install +sudo dpkg -i packages/antigravity_2.0.1-ai-providers-1_amd64.deb +``` + +## Detailed Build Process + +### Step 1: Extract app.asar + +The application code is packaged in `app.asar`. Extract it to modify: + +```bash +# Extract app +./scripts/extract-app.sh + +# This creates: src/app-extracted/ +``` + +### Step 2: Modify Code + +Navigate to extracted files: + +```bash +cd src/app-extracted/dist/ +``` + +**Key Files:** + +- `services/aiProviderService.js` - AI provider management +- `services/settingsService.js` - Application settings +- `ipcHandlers.js` - IPC communication +- `aiProviderAPI.ts` - TypeScript API wrapper +- `ai-provider-settings.html` - Complete GUI + +**Example Modifications:** + +#### Add a New Provider Preset + +Edit `services/aiProviderService.js`: + +```javascript +const PROVIDER_PRESETS = { + // ... existing presets ... + + "My Custom Provider": { + type: AIProviderType.CUSTOM, + endpoint: "https://api.myprovider.com/v1", + models: ["model-1", "model-2"], + capabilities: [AIProviderCapability.CHAT, AIProviderCapability.STREAMING], + }, +}; +``` + +#### Add New IPC Handler + +Edit `ipcHandlers.js`: + +```javascript +electron_1.ipcMain.handle('ai:my-new-handler', async (_event, arg) => { + // Your handler logic + return result; +}); +``` + +#### Customize GUI + +Edit `ai-provider-settings.html`: + +```html + +
Configure and manage your AI provider connections
+Antigravity has been redesigned to put agents first with new capabilities. If you'd still like a code editor, you can download it as a separate app named Antigravity IDE.
+ + + + +