Complete source code - AI Provider Edition v2.0.1
Added complete source code and pre-compiled application: Source Code: - app.asar (compiled Electron app) - app-extracted/ (all extracted source files) - dist/services/aiProviderService.js - dist/services/settingsService.js - dist/ipcHandlers.js - dist/aiProviderAPI.ts - dist/ai-provider-settings.html - And all other application files Build Tools: - scripts/extract-app.sh - scripts/repack-app.sh - scripts/build-deb.sh - scripts/install-deb.sh Documentation: - SOURCE_CODE.md (repository structure) - BUILD.md (build instructions) - README.md (overview) - docs/ (complete API docs) - AI_PROVIDER_SPECIFICATION.md - AI_PROVIDER_README.md - IMPLEMENTATION_SUMMARY.md Features included: - 17+ AI provider presets - One-click provider setup - Model auto-fetching - Connection testing - Modern GUI interface - Complete IPC handlers (14 new) - TypeScript API wrapper - Persistent settings Ready to build and customize!
This commit is contained in:
140
scripts/build-deb.sh
Executable file
140
scripts/build-deb.sh
Executable file
@@ -0,0 +1,140 @@
|
||||
#!/bin/bash
|
||||
# Build .deb package from source
|
||||
# Usage: ./scripts/build-deb.sh
|
||||
|
||||
set -e
|
||||
|
||||
VERSION="2.0.1-ai-providers-1"
|
||||
DEB_FILE="antigravity_${VERSION}_amd64.deb"
|
||||
|
||||
echo "Building Antigravity .deb package..."
|
||||
|
||||
# Check if app.asar exists
|
||||
if [ ! -f "src/app.asar" ]; then
|
||||
echo "Error: src/app.asar not found"
|
||||
echo "Run extract-app.sh and repack-app.sh first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create temporary directory
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
echo "Using temp directory: $TEMP_DIR"
|
||||
|
||||
# Create package structure
|
||||
mkdir -p "$TEMP_DIR/DEBIAN"
|
||||
mkdir -p "$TEMP_DIR/opt/antigravity"
|
||||
|
||||
# Copy application files
|
||||
echo "Copying application files..."
|
||||
cp -r Antigravity-x64/* "$TEMP_DIR/opt/antigravity/"
|
||||
|
||||
# Replace app.asar with our modified version
|
||||
cp src/app.asar "$TEMP_DIR/opt/antigravity/resources/"
|
||||
|
||||
# Create control file
|
||||
cat > "$TEMP_DIR/DEBIAN/control" << 'EOF'
|
||||
Package: antigravity
|
||||
Version: VERSION_PLACEHOLDER
|
||||
Section: development
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: libc6 (>= 2.17), libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1
|
||||
Maintainer: Antigravity Team <support@antigravity.dev>
|
||||
Description: Antigravity IDE with AI Provider GUI Support
|
||||
Antigravity is a modern IDE powered by AI that helps developers
|
||||
write better code faster. This version includes comprehensive
|
||||
GUI support for managing multiple AI providers including OpenAI,
|
||||
Anthropic, Google Gemini, Ollama, OpenRouter, and 15+ other providers.
|
||||
EOF
|
||||
|
||||
# Replace version placeholder
|
||||
sed -i "s/VERSION_PLACEHOLDER/$VERSION/" "$TEMP_DIR/DEBIAN/control"
|
||||
|
||||
# Create preinst
|
||||
cat > "$TEMP_DIR/DEBIAN/preinst" << 'EOF'
|
||||
#!/bin/bash
|
||||
set -e
|
||||
echo "Preparing to install Antigravity..."
|
||||
if [ -d /opt/antigravity ]; then
|
||||
echo "Removing previous installation..."
|
||||
rm -rf /opt/antigravity
|
||||
fi
|
||||
mkdir -p /opt/antigravity
|
||||
mkdir -p ~/.config/antigravity
|
||||
mkdir -p ~/.cache/antigravity
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
# Create postinst
|
||||
cat > "$TEMP_DIR/DEBIAN/postinst" << 'EOF'
|
||||
#!/bin/bash
|
||||
set -e
|
||||
echo "Installing Antigravity..."
|
||||
chmod 755 /opt/antigravity/antigravity
|
||||
chmod 644 /opt/antigravity/resources.pak
|
||||
chmod 644 /opt/antigravity/icudtl.dat
|
||||
chmod +x /opt/antigravity/chrome-sandbox 2>/dev/null || true
|
||||
|
||||
mkdir -p /usr/share/applications
|
||||
cat > /usr/share/applications/antigravity.desktop << 'DESKTOP'
|
||||
[Desktop Entry]
|
||||
Version=2.0.1-ai-providers-1
|
||||
Name=Antigravity IDE
|
||||
Comment=AI-Powered Development Environment with Multi-Provider Support
|
||||
Exec=/opt/antigravity/antigravity %U
|
||||
Icon=/opt/antigravity/icon.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Development;IDE;TextEditor;
|
||||
Keywords=code;developer;ai;programming;ide;
|
||||
StartupWMClass=antigravity
|
||||
DESKTOP
|
||||
|
||||
ln -sf /opt/antigravity/antigravity /usr/local/bin/antigravity
|
||||
update-desktop-database /usr/share/applications/ 2>/dev/null || true
|
||||
echo "Antigravity installed successfully!"
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
# Create prerm
|
||||
cat > "$TEMP_DIR/DEBIAN/prerm" << 'EOF'
|
||||
#!/bin/bash
|
||||
set -e
|
||||
pkill -f antigravity 2>/dev/null || true
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
# Create postrm
|
||||
cat > "$TEMP_DIR/DEBIAN/postrm" << 'EOF'
|
||||
#!/bin/bash
|
||||
set -e
|
||||
rm -f /usr/share/applications/antigravity.desktop
|
||||
rm -f /usr/local/bin/antigravity
|
||||
update-desktop-database /usr/share/applications/ 2>/dev/null || true
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
# Make scripts executable
|
||||
chmod +x "$TEMP_DIR/DEBIAN/preinst"
|
||||
chmod +x "$TEMP_DIR/DEBIAN/postinst"
|
||||
chmod +x "$TEMP_DIR/DEBIAN/prerm"
|
||||
chmod +x "$TEMP_DIR/DEBIAN/postrm"
|
||||
|
||||
# Build package
|
||||
echo "Building .deb package..."
|
||||
dpkg-deb --build "$TEMP_DIR" "$DEB_FILE"
|
||||
|
||||
# Move to packages directory
|
||||
mkdir -p packages
|
||||
mv "$DEB_FILE" packages/
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$TEMP_DIR"
|
||||
|
||||
echo ""
|
||||
echo "✅ Build complete!"
|
||||
echo "Package created: packages/$DEB_FILE"
|
||||
echo ""
|
||||
echo "To install:"
|
||||
echo " sudo dpkg -i packages/$DEB_FILE"
|
||||
echo " antigravity"
|
||||
33
scripts/extract-app.sh
Executable file
33
scripts/extract-app.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# Extract app.asar to source directory
|
||||
# Usage: ./scripts/extract-app.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Extracting app.asar..."
|
||||
|
||||
# Check if asar is installed
|
||||
if ! command -v npx &> /dev/null; then
|
||||
echo "Error: npx is required but not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install asar if needed
|
||||
if ! npx asar --version &> /dev/null; then
|
||||
echo "Installing asar..."
|
||||
npm install -g asar
|
||||
fi
|
||||
|
||||
# Create extraction directory
|
||||
mkdir -p src/app-extracted
|
||||
|
||||
# Extract app.asar
|
||||
cd src
|
||||
npx asar extract app.asar app-extracted
|
||||
|
||||
echo ""
|
||||
echo "✅ Extraction complete!"
|
||||
echo "Source files are in: src/app-extracted/"
|
||||
echo ""
|
||||
echo "You can now edit files in src/app-extracted/dist/"
|
||||
echo "Then repack with: ./scripts/repack-app.sh"
|
||||
36
scripts/install-deb.sh
Executable file
36
scripts/install-deb.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Install Antigravity from local .deb file
|
||||
# Usage: ./scripts/install-deb.sh [path-to-deb]
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
DEB_FILE="packages/antigravity_2.0.1-ai-providers-1_amd64.deb"
|
||||
else
|
||||
DEB_FILE="$1"
|
||||
fi
|
||||
|
||||
if [ ! -f "$DEB_FILE" ]; then
|
||||
echo "Error: $DEB_FILE not found"
|
||||
echo "Usage: $0 [path-to-deb-file]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing Antigravity from: $DEB_FILE"
|
||||
echo ""
|
||||
|
||||
# Install package
|
||||
sudo dpkg -i "$DEB_FILE"
|
||||
|
||||
# Check for dependencies
|
||||
echo ""
|
||||
echo "Checking dependencies..."
|
||||
sudo apt-get install -f -y
|
||||
|
||||
echo ""
|
||||
echo "✅ Installation complete!"
|
||||
echo ""
|
||||
echo "To launch Antigravity:"
|
||||
echo " antigravity"
|
||||
echo ""
|
||||
echo "Or find 'Antigravity IDE' in your application menu."
|
||||
30
scripts/repack-app.sh
Executable file
30
scripts/repack-app.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# Repack extracted app to app.asar
|
||||
# Usage: ./scripts/repack-app.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Repacking app.asar..."
|
||||
|
||||
# Check if asar is installed
|
||||
if ! command -v npx &> /dev/null; then
|
||||
echo "Error: npx is required but not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if extraction directory exists
|
||||
if [ ! -d "src/app-extracted" ]; then
|
||||
echo "Error: src/app-extracted directory not found"
|
||||
echo "Run extract-app.sh first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Repack app.asar
|
||||
cd src
|
||||
npx asar pack app-extracted app.asar
|
||||
|
||||
echo ""
|
||||
echo "✅ Repacking complete!"
|
||||
echo "Updated app.asar is in: src/app.asar"
|
||||
echo ""
|
||||
echo "You can now build the .deb package with: ./scripts/build-deb.sh"
|
||||
Reference in New Issue
Block a user