Add macOS menu bar app with chat and settings
- Restructure project into three targets: - AppleIntelligenceCore: Shared gRPC service code - AppleIntelligenceServer: CLI server - AppleIntelligenceApp: Menu bar app - Menu bar app features: - Toggle server on/off from menu bar - Chat window with streaming AI responses - Settings: host, port, API key, auto-start, launch at login - Proper window focus handling for menu bar apps - Add build scripts for distribution: - build-app.sh: Creates signed .app bundle - create-dmg.sh: Creates distributable DMG 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+80
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
APP_NAME="Apple Intelligence Server"
|
||||
BUNDLE_ID="com.svrnty.apple-intelligence-server"
|
||||
VERSION="1.0.0"
|
||||
BUILD_NUMBER="1"
|
||||
MIN_OS_VERSION="26.0"
|
||||
|
||||
# Paths
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
BUILD_DIR="$PROJECT_DIR/.build/release"
|
||||
APP_BUNDLE="$PROJECT_DIR/dist/$APP_NAME.app"
|
||||
CONTENTS_DIR="$APP_BUNDLE/Contents"
|
||||
MACOS_DIR="$CONTENTS_DIR/MacOS"
|
||||
RESOURCES_DIR="$CONTENTS_DIR/Resources"
|
||||
|
||||
echo "Building release binary..."
|
||||
cd "$PROJECT_DIR"
|
||||
swift build -c release --product AppleIntelligenceApp
|
||||
|
||||
echo "Creating app bundle..."
|
||||
rm -rf "$APP_BUNDLE"
|
||||
mkdir -p "$MACOS_DIR"
|
||||
mkdir -p "$RESOURCES_DIR"
|
||||
|
||||
echo "Copying executable..."
|
||||
cp "$BUILD_DIR/AppleIntelligenceApp" "$MACOS_DIR/$APP_NAME"
|
||||
|
||||
echo "Creating Info.plist..."
|
||||
cat > "$CONTENTS_DIR/Info.plist" << EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$APP_NAME</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>AppIcon</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$BUNDLE_ID</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$APP_NAME</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$VERSION</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$BUILD_NUMBER</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$MIN_OS_VERSION</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>Apple Intelligence Server needs local network access to accept connections from other devices on your network.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
echo "Creating PkgInfo..."
|
||||
echo -n "APPL????" > "$CONTENTS_DIR/PkgInfo"
|
||||
|
||||
echo ""
|
||||
echo "App bundle created at: $APP_BUNDLE"
|
||||
echo ""
|
||||
echo "Next steps for distribution:"
|
||||
echo "1. Add an app icon (AppIcon.icns) to $RESOURCES_DIR"
|
||||
echo "2. Code sign: codesign --deep --force --verify --verbose --sign \"Developer ID Application: YOUR NAME (TEAM_ID)\" \"$APP_BUNDLE\""
|
||||
echo "3. Notarize: xcrun notarytool submit \"$APP_BUNDLE\" --apple-id YOUR_APPLE_ID --password APP_SPECIFIC_PASSWORD --team-id TEAM_ID --wait"
|
||||
echo "4. Staple: xcrun stapler staple \"$APP_BUNDLE\""
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
APP_NAME="Apple Intelligence Server"
|
||||
DMG_NAME="AppleIntelligenceServer"
|
||||
VERSION="1.0.0"
|
||||
|
||||
# Paths
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
DIST_DIR="$PROJECT_DIR/dist"
|
||||
APP_BUNDLE="$DIST_DIR/$APP_NAME.app"
|
||||
DMG_PATH="$DIST_DIR/$DMG_NAME-$VERSION.dmg"
|
||||
TEMP_DMG="$DIST_DIR/temp.dmg"
|
||||
|
||||
# Check if app bundle exists
|
||||
if [ ! -d "$APP_BUNDLE" ]; then
|
||||
echo "App bundle not found. Running build-app.sh first..."
|
||||
"$SCRIPT_DIR/build-app.sh"
|
||||
fi
|
||||
|
||||
echo "Creating DMG..."
|
||||
|
||||
# Remove old DMG if exists
|
||||
rm -f "$DMG_PATH"
|
||||
rm -f "$TEMP_DMG"
|
||||
|
||||
# Create a temporary directory for DMG contents
|
||||
DMG_TEMP_DIR="$DIST_DIR/dmg-temp"
|
||||
rm -rf "$DMG_TEMP_DIR"
|
||||
mkdir -p "$DMG_TEMP_DIR"
|
||||
|
||||
# Copy app to temp directory
|
||||
cp -R "$APP_BUNDLE" "$DMG_TEMP_DIR/"
|
||||
|
||||
# Create symbolic link to Applications folder
|
||||
ln -s /Applications "$DMG_TEMP_DIR/Applications"
|
||||
|
||||
# Create the DMG
|
||||
hdiutil create -volname "$APP_NAME" \
|
||||
-srcfolder "$DMG_TEMP_DIR" \
|
||||
-ov -format UDRW "$TEMP_DMG"
|
||||
|
||||
# Convert to compressed DMG
|
||||
hdiutil convert "$TEMP_DMG" -format UDZO -o "$DMG_PATH"
|
||||
|
||||
# Clean up
|
||||
rm -f "$TEMP_DMG"
|
||||
rm -rf "$DMG_TEMP_DIR"
|
||||
|
||||
echo ""
|
||||
echo "DMG created: $DMG_PATH"
|
||||
echo ""
|
||||
echo "Size: $(du -h "$DMG_PATH" | cut -f1)"
|
||||
echo ""
|
||||
echo "To distribute:"
|
||||
echo "1. Code sign the app (requires Apple Developer account)"
|
||||
echo "2. Notarize the DMG (required for Gatekeeper)"
|
||||
echo "3. Share the DMG file"
|
||||
Reference in New Issue
Block a user