-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·148 lines (136 loc) · 4.73 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·148 lines (136 loc) · 4.73 KB
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
#!/bin/bash
# AiAgentTest1 Build Script
echo "🚀 Building AiAgentTest1..."
# Check if we're in the right directory
if [ ! -f "Package.swift" ]; then
echo "❌ Error: Package.swift not found. Please run this script from the project root."
exit 1
fi
# Clean previous builds
echo "🧹 Cleaning previous builds..."
rm -rf .build
rm -rf AiAgentTest1.app
# Build the project
echo "🔨 Building project..."
swift build -c release
if [ $? -ne 0 ]; then
echo "❌ Build failed!"
exit 1
fi
# Create app bundle
echo "📦 Creating app bundle..."
mkdir -p AiAgentTest1.app/Contents/MacOS
mkdir -p AiAgentTest1.app/Contents/Resources
# Copy executable
cp .build/release/AiAgentTest1 AiAgentTest1.app/Contents/MacOS/
# Create Entitlements.plist
cat > AiAgentTest1.app/Contents/Entitlements.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>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.personal-information.addressbook</key>
<true/>
<key>com.apple.security.personal-information.calendars</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.systempreferences</string>
<string>com.apple.finder</string>
<string>com.apple.safari</string>
<string>com.google.Chrome</string>
<string>com.microsoft.VSCode</string>
<string>com.apple.Terminal</string>
</array>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array>
<string>/Desktop/</string>
<string>/Documents/</string>
<string>/Downloads/</string>
</array>
</dict>
</plist>
EOF
# Create Info.plist
cat > AiAgentTest1.app/Contents/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>AiAgentTest1</string>
<key>CFBundleIdentifier</key>
<string>com.caydyan.AiAgentTest1</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AiAgentTest1</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSAppleEventsUsageDescription</key>
<string>This app needs to send Apple Events to control other applications on your computer.</string>
<key>NSSystemAdministrationUsageDescription</key>
<string>This app needs system administration privileges to control your computer through AI commands.</string>
<key>NSScreenCaptureUsageDescription</key>
<string>This app needs screen capture permission to take screenshots for AI analysis.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for voice input features.</string>
<key>NSAccessibilityUsageDescription</key>
<string>This app needs accessibility permissions to control your computer through AI commands.</string>
<key>CGDisableCoalescedUpdates</key>
<true/>
<key>NSSupportsAutomaticTermination</key>
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSBackgroundOnly</key>
<false/>
<key>NSRequiresAquaSystemAppearance</key>
<false/>
</dict>
</plist>
EOF
# Make executable
chmod +x AiAgentTest1.app/Contents/MacOS/AiAgentTest1
echo "✅ Build completed successfully!"
echo "📱 App bundle created: AiAgentTest1.app"
echo ""
echo "To run the app:"
echo " open AiAgentTest1.app"
echo ""
echo "Or run directly:"
echo " ./AiAgentTest1.app/Contents/MacOS/AiAgentTest1"
echo ""
echo "📝 Note: You'll need to:"
echo " 1. Install cliclick if you haven't already: brew install cliclick"
echo " 2. Grant accessibility permissions when prompted"
echo " 3. Enter your OpenAI API key in Settings"