mageagent-local 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>MageAgentMenuBar</string>
9
+ <key>CFBundleIconFile</key>
10
+ <string>AppIcon</string>
11
+ <key>CFBundleIconName</key>
12
+ <string>AppIcon</string>
13
+ <key>CFBundleIdentifier</key>
14
+ <string>ai.adverant.mageagent.menubar</string>
15
+ <key>CFBundleInfoDictionaryVersion</key>
16
+ <string>6.0</string>
17
+ <key>CFBundleName</key>
18
+ <string>MageAgent</string>
19
+ <key>CFBundleDisplayName</key>
20
+ <string>MageAgent</string>
21
+ <key>CFBundlePackageType</key>
22
+ <string>APPL</string>
23
+ <key>CFBundleShortVersionString</key>
24
+ <string>2.0.0</string>
25
+ <key>CFBundleVersion</key>
26
+ <string>1</string>
27
+ <key>LSApplicationCategoryType</key>
28
+ <string>public.app-category.developer-tools</string>
29
+ <key>LSMinimumSystemVersion</key>
30
+ <string>13.0</string>
31
+ <key>LSUIElement</key>
32
+ <true/>
33
+ <key>NSHumanReadableCopyright</key>
34
+ <string>Copyright © 2025 Adverant. All rights reserved.</string>
35
+ <key>NSPrincipalClass</key>
36
+ <string>NSApplication</string>
37
+ </dict>
38
+ </plist>
@@ -0,0 +1,16 @@
1
+ import Cocoa
2
+
3
+ // MARK: - Application Entry Point
4
+ // Using NSApplicationMain pattern for proper object lifecycle management
5
+ // The AppDelegate is stored as a strong reference to prevent deallocation
6
+
7
+ // Strong reference to prevent ARC from deallocating the delegate
8
+ // This is CRITICAL - NSApplication.delegate is a WEAK reference
9
+ private var appDelegateReference: AppDelegate!
10
+
11
+ autoreleasepool {
12
+ let app = NSApplication.shared
13
+ appDelegateReference = AppDelegate()
14
+ app.delegate = appDelegateReference
15
+ app.run()
16
+ }
@@ -0,0 +1,18 @@
1
+ // swift-tools-version:5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "MageAgentMenuBar",
6
+ platforms: [
7
+ .macOS(.v13)
8
+ ],
9
+ targets: [
10
+ .executableTarget(
11
+ name: "MageAgentMenuBar",
12
+ path: "MageAgentMenuBar",
13
+ resources: [
14
+ .process("Info.plist")
15
+ ]
16
+ )
17
+ ]
18
+ )
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>MageAgentMenuBar</string>
9
+ <key>CFBundleIconFile</key>
10
+ <string>AppIcon</string>
11
+ <key>CFBundleIconName</key>
12
+ <string>AppIcon</string>
13
+ <key>CFBundleIdentifier</key>
14
+ <string>ai.adverant.mageagent.menubar</string>
15
+ <key>CFBundleInfoDictionaryVersion</key>
16
+ <string>6.0</string>
17
+ <key>CFBundleName</key>
18
+ <string>MageAgent</string>
19
+ <key>CFBundleDisplayName</key>
20
+ <string>MageAgent</string>
21
+ <key>CFBundlePackageType</key>
22
+ <string>APPL</string>
23
+ <key>CFBundleShortVersionString</key>
24
+ <string>2.0.0</string>
25
+ <key>CFBundleVersion</key>
26
+ <string>1</string>
27
+ <key>LSApplicationCategoryType</key>
28
+ <string>public.app-category.developer-tools</string>
29
+ <key>LSMinimumSystemVersion</key>
30
+ <string>13.0</string>
31
+ <key>LSUIElement</key>
32
+ <true/>
33
+ <key>NSHumanReadableCopyright</key>
34
+ <string>Copyright © 2025 Adverant. All rights reserved.</string>
35
+ <key>NSPrincipalClass</key>
36
+ <string>NSApplication</string>
37
+ </dict>
38
+ </plist>
@@ -0,0 +1,96 @@
1
+ #!/bin/bash
2
+ # Build MageAgent Menu Bar App
3
+
4
+ set -e
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
+ APP_NAME="MageAgentMenuBar"
8
+ BUILD_DIR="$SCRIPT_DIR/build"
9
+ APP_DIR="$BUILD_DIR/$APP_NAME.app"
10
+ CONTENTS_DIR="$APP_DIR/Contents"
11
+ MACOS_DIR="$CONTENTS_DIR/MacOS"
12
+ RESOURCES_DIR="$CONTENTS_DIR/Resources"
13
+
14
+ echo "Building MageAgent Menu Bar App..."
15
+
16
+ # Clean previous build
17
+ rm -rf "$BUILD_DIR"
18
+ mkdir -p "$MACOS_DIR" "$RESOURCES_DIR"
19
+
20
+ # Compile Swift files
21
+ echo "Compiling Swift..."
22
+ swiftc -o "$MACOS_DIR/$APP_NAME" \
23
+ -framework Cocoa \
24
+ -framework UserNotifications \
25
+ -target arm64-apple-macos13.0 \
26
+ -O \
27
+ "$SCRIPT_DIR/MageAgentMenuBar/main.swift" \
28
+ "$SCRIPT_DIR/MageAgentMenuBar/AppDelegate.swift"
29
+
30
+ # Copy Info.plist
31
+ echo "Copying Info.plist..."
32
+ cp "$SCRIPT_DIR/MageAgentMenuBar/Info.plist" "$CONTENTS_DIR/Info.plist"
33
+
34
+ # Create white app icon with transparent background
35
+ echo "Creating white app icon..."
36
+ ICONSET_DIR="$BUILD_DIR/AppIcon.iconset"
37
+ mkdir -p "$ICONSET_DIR"
38
+
39
+ # Use Python to create white icons from the transparent source
40
+ python3 << 'PYTHON_EOF'
41
+ from PIL import Image
42
+ import os
43
+
44
+ source = "/Users/don/Adverant/Adverant.ai/public/brand/adverant-icon-github-final.png"
45
+ output_dir = os.path.expanduser("~/.claude/MageAgentMenuBar/build/AppIcon.iconset")
46
+
47
+ img = Image.open(source).convert("RGBA")
48
+ pixels = img.load()
49
+ width, height = img.size
50
+
51
+ # Convert to white (preserve alpha)
52
+ for y in range(height):
53
+ for x in range(width):
54
+ r, g, b, a = pixels[x, y]
55
+ if a > 0:
56
+ pixels[x, y] = (255, 255, 255, a)
57
+
58
+ sizes = [
59
+ (16, "icon_16x16.png"), (32, "icon_16x16@2x.png"),
60
+ (32, "icon_32x32.png"), (64, "icon_32x32@2x.png"),
61
+ (128, "icon_128x128.png"), (256, "icon_128x128@2x.png"),
62
+ (256, "icon_256x256.png"), (512, "icon_256x256@2x.png"),
63
+ (512, "icon_512x512.png"), (1024, "icon_512x512@2x.png"),
64
+ ]
65
+
66
+ for size, filename in sizes:
67
+ resized = img.resize((size, size), Image.LANCZOS)
68
+ resized.save(os.path.join(output_dir, filename), "PNG")
69
+ PYTHON_EOF
70
+
71
+ # Convert to icns
72
+ iconutil -c icns "$ICONSET_DIR" -o "$RESOURCES_DIR/AppIcon.icns" 2>/dev/null || echo "Note: iconutil not available"
73
+
74
+ # Copy menu bar icon
75
+ cp "$HOME/.claude/mageagent-menubar/icons/icon_18x18@2x.png" "$RESOURCES_DIR/icon.png" 2>/dev/null || true
76
+
77
+ # Create PkgInfo
78
+ echo "APPLMage" > "$CONTENTS_DIR/PkgInfo"
79
+
80
+ echo ""
81
+ echo "Build complete!"
82
+ echo "App location: $APP_DIR"
83
+ echo ""
84
+
85
+ # Install to Applications
86
+ INSTALL_DIR="/Applications"
87
+ if [ -d "$INSTALL_DIR" ]; then
88
+ echo "Installing to /Applications..."
89
+ rm -rf "$INSTALL_DIR/$APP_NAME.app"
90
+ cp -R "$APP_DIR" "$INSTALL_DIR/"
91
+ echo "Installed to $INSTALL_DIR/$APP_NAME.app"
92
+ fi
93
+
94
+ echo ""
95
+ echo "To run: open /Applications/$APP_NAME.app"
96
+ echo "To add to Login Items: System Settings > General > Login Items > + > $APP_NAME"
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "mageagent-local",
3
+ "version": "2.0.1",
4
+ "description": "Run 4 AI models together on Apple Silicon. Get results that rival cloud AI. Pay nothing. Forever.",
5
+ "keywords": [
6
+ "ai",
7
+ "llm",
8
+ "mlx",
9
+ "apple-silicon",
10
+ "m1",
11
+ "m2",
12
+ "m3",
13
+ "m4",
14
+ "multi-model",
15
+ "orchestration",
16
+ "qwen",
17
+ "hermes",
18
+ "local-ai",
19
+ "private-ai",
20
+ "offline-ai",
21
+ "claude-code",
22
+ "menubar",
23
+ "macos",
24
+ "react-loop",
25
+ "tool-calling",
26
+ "mixture-of-agents"
27
+ ],
28
+ "homepage": "https://github.com/adverant/nexus-local-mageagent#readme",
29
+ "bugs": {
30
+ "url": "https://github.com/adverant/nexus-local-mageagent/issues"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/adverant/nexus-local-mageagent.git"
35
+ },
36
+ "license": "MIT",
37
+ "author": "Adverant <info@adverant.ai>",
38
+ "type": "module",
39
+ "bin": {
40
+ "mageagent": "./bin/mageagent.js"
41
+ },
42
+ "files": [
43
+ "bin/",
44
+ "mageagent/",
45
+ "menubar-app/",
46
+ "scripts/",
47
+ "config/",
48
+ "docs/",
49
+ "README.md",
50
+ "QUICK_START.md",
51
+ "LICENSE"
52
+ ],
53
+ "scripts": {
54
+ "postinstall": "node bin/postinstall.js",
55
+ "start": "node bin/mageagent.js start",
56
+ "stop": "node bin/mageagent.js stop",
57
+ "restart": "node bin/mageagent.js restart",
58
+ "status": "node bin/mageagent.js status",
59
+ "logs": "node bin/mageagent.js logs",
60
+ "test": "node bin/mageagent.js test",
61
+ "install:all": "npm run install:deps && npm run install:models && npm run install:menubar && npm run install:launchagent",
62
+ "install:deps": "pip install -r requirements.txt",
63
+ "install:models": "node bin/mageagent.js install-models",
64
+ "install:menubar": "cd menubar-app && ./build.sh",
65
+ "install:launchagent": "node bin/install-launchagent.js",
66
+ "uninstall:menubar": "rm -rf /Applications/MageAgentMenuBar.app",
67
+ "uninstall:launchagent": "launchctl unload ~/Library/LaunchAgents/ai.adverant.mageagent.plist 2>/dev/null; launchctl unload ~/Library/LaunchAgents/ai.adverant.mageagent.menubar.plist 2>/dev/null",
68
+ "setup": "npm run install:all && npm run start",
69
+ "doctor": "node bin/mageagent.js doctor"
70
+ },
71
+ "engines": {
72
+ "node": ">=18.0.0"
73
+ },
74
+ "os": [
75
+ "darwin"
76
+ ],
77
+ "cpu": [
78
+ "arm64"
79
+ ],
80
+ "preferGlobal": true
81
+ }
@@ -0,0 +1,196 @@
1
+ #!/bin/bash
2
+
3
+ # MageAgent DMG Installer Builder
4
+ # Creates a professional macOS DMG installer
5
+
6
+ set -e
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
10
+ BUILD_DIR="$PROJECT_ROOT/dist"
11
+ DMG_NAME="MageAgent-2.0.0"
12
+ VOLUME_NAME="MageAgent Installer"
13
+
14
+ # Colors
15
+ RED='\033[0;31m'
16
+ GREEN='\033[0;32m'
17
+ YELLOW='\033[1;33m'
18
+ BLUE='\033[0;34m'
19
+ NC='\033[0m'
20
+
21
+ echo -e "${BLUE}========================================${NC}"
22
+ echo -e "${BLUE} MageAgent DMG Installer Builder${NC}"
23
+ echo -e "${BLUE}========================================${NC}"
24
+ echo ""
25
+
26
+ # Check for required tools
27
+ if ! command -v hdiutil &> /dev/null; then
28
+ echo -e "${RED}Error: hdiutil not found (requires macOS)${NC}"
29
+ exit 1
30
+ fi
31
+
32
+ # Create build directory
33
+ echo -e "${YELLOW}Creating build directory...${NC}"
34
+ rm -rf "$BUILD_DIR"
35
+ mkdir -p "$BUILD_DIR/dmg-contents"
36
+
37
+ # Build the menu bar app
38
+ echo -e "${YELLOW}Building MageAgentMenuBar.app...${NC}"
39
+ cd "$PROJECT_ROOT/menubar-app"
40
+ ./build.sh
41
+
42
+ # Copy app to DMG contents
43
+ echo -e "${YELLOW}Preparing DMG contents...${NC}"
44
+ cp -R "$PROJECT_ROOT/menubar-app/build/MageAgentMenuBar.app" "$BUILD_DIR/dmg-contents/"
45
+
46
+ # Create installer script that will run on first launch
47
+ cat > "$BUILD_DIR/dmg-contents/Install MageAgent.command" << 'INSTALLER'
48
+ #!/bin/bash
49
+
50
+ # MageAgent Installer Script
51
+ # Run this after dragging MageAgentMenuBar.app to Applications
52
+
53
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
54
+
55
+ echo "=========================================="
56
+ echo " MageAgent Installation"
57
+ echo "=========================================="
58
+ echo ""
59
+
60
+ # Check for Apple Silicon
61
+ if [[ $(uname -m) != "arm64" ]]; then
62
+ echo "Error: MageAgent requires Apple Silicon (M1/M2/M3/M4)"
63
+ exit 1
64
+ fi
65
+
66
+ # Create directories
67
+ echo "Creating directories..."
68
+ mkdir -p ~/.claude/mageagent
69
+ mkdir -p ~/.claude/scripts
70
+ mkdir -p ~/.claude/debug
71
+ mkdir -p ~/.cache/mlx-models
72
+
73
+ # Download server files from GitHub
74
+ echo "Downloading server components..."
75
+ REPO_URL="https://raw.githubusercontent.com/adverant/nexus-local-mageagent/main"
76
+
77
+ curl -sL "$REPO_URL/mageagent/server.py" -o ~/.claude/mageagent/server.py
78
+ curl -sL "$REPO_URL/scripts/mageagent-server.sh" -o ~/.claude/scripts/mageagent-server.sh
79
+ chmod +x ~/.claude/scripts/mageagent-server.sh
80
+
81
+ # Install Python dependencies
82
+ echo "Installing Python dependencies..."
83
+ pip3 install --quiet mlx mlx-lm fastapi uvicorn pydantic huggingface_hub 2>/dev/null
84
+
85
+ # Create LaunchAgent for server
86
+ echo "Setting up auto-start..."
87
+ cat > ~/Library/LaunchAgents/ai.adverant.mageagent.plist << 'PLIST'
88
+ <?xml version="1.0" encoding="UTF-8"?>
89
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
90
+ <plist version="1.0">
91
+ <dict>
92
+ <key>Label</key>
93
+ <string>ai.adverant.mageagent</string>
94
+ <key>ProgramArguments</key>
95
+ <array>
96
+ <string>/bin/bash</string>
97
+ <string>-c</string>
98
+ <string>~/.claude/scripts/mageagent-server.sh start</string>
99
+ </array>
100
+ <key>RunAtLoad</key>
101
+ <true/>
102
+ <key>KeepAlive</key>
103
+ <false/>
104
+ <key>StandardOutPath</key>
105
+ <string>~/.claude/debug/mageagent.log</string>
106
+ <key>StandardErrorPath</key>
107
+ <string>~/.claude/debug/mageagent.error.log</string>
108
+ </dict>
109
+ </plist>
110
+ PLIST
111
+
112
+ launchctl load ~/Library/LaunchAgents/ai.adverant.mageagent.plist 2>/dev/null || true
113
+
114
+ # Start the server
115
+ echo "Starting MageAgent server..."
116
+ ~/.claude/scripts/mageagent-server.sh start
117
+
118
+ # Wait for server
119
+ sleep 3
120
+
121
+ # Test
122
+ if curl -s http://localhost:3457/health > /dev/null 2>&1; then
123
+ echo ""
124
+ echo "=========================================="
125
+ echo " Installation Complete!"
126
+ echo "=========================================="
127
+ echo ""
128
+ echo "MageAgent is running at: http://localhost:3457"
129
+ echo ""
130
+ echo "Next steps:"
131
+ echo " 1. Open MageAgentMenuBar from Applications"
132
+ echo " 2. Click the menu bar icon to manage the server"
133
+ echo " 3. Download models (~110GB) via menu: Load Models > Load All"
134
+ echo ""
135
+ echo "Documentation: https://github.com/adverant/nexus-local-mageagent"
136
+ else
137
+ echo ""
138
+ echo "Warning: Server may not have started correctly."
139
+ echo "Check logs: ~/.claude/debug/mageagent.log"
140
+ fi
141
+
142
+ echo ""
143
+ echo "Press Enter to close..."
144
+ read
145
+ INSTALLER
146
+
147
+ chmod +x "$BUILD_DIR/dmg-contents/Install MageAgent.command"
148
+
149
+ # Create README
150
+ cat > "$BUILD_DIR/dmg-contents/README.txt" << 'README'
151
+ MageAgent - Multi-Model AI Orchestration for Apple Silicon
152
+ ==========================================================
153
+
154
+ Installation Steps:
155
+ 1. Drag MageAgentMenuBar.app to your Applications folder
156
+ 2. Double-click "Install MageAgent.command" to complete setup
157
+ 3. Open MageAgentMenuBar from Applications
158
+
159
+ Requirements:
160
+ - macOS 13.0 (Ventura) or later
161
+ - Apple Silicon (M1/M2/M3/M4)
162
+ - 64GB+ unified memory recommended (128GB for all models)
163
+ - Python 3.9+
164
+
165
+ The installer will:
166
+ - Download server components from GitHub
167
+ - Install Python dependencies (MLX, FastAPI)
168
+ - Configure auto-start on login
169
+ - Start the MageAgent server
170
+
171
+ Models (~110GB total) are downloaded on-demand via the menu bar app.
172
+
173
+ For help: https://github.com/adverant/nexus-local-mageagent
174
+ README
175
+
176
+ # Create symlink to Applications
177
+ ln -s /Applications "$BUILD_DIR/dmg-contents/Applications"
178
+
179
+ # Create DMG
180
+ echo -e "${YELLOW}Creating DMG...${NC}"
181
+ hdiutil create -volname "$VOLUME_NAME" \
182
+ -srcfolder "$BUILD_DIR/dmg-contents" \
183
+ -ov -format UDZO \
184
+ "$BUILD_DIR/$DMG_NAME.dmg"
185
+
186
+ # Clean up
187
+ rm -rf "$BUILD_DIR/dmg-contents"
188
+
189
+ echo ""
190
+ echo -e "${GREEN}========================================${NC}"
191
+ echo -e "${GREEN} DMG Created Successfully!${NC}"
192
+ echo -e "${GREEN}========================================${NC}"
193
+ echo ""
194
+ echo -e "DMG Location: ${BLUE}$BUILD_DIR/$DMG_NAME.dmg${NC}"
195
+ echo ""
196
+ echo "To test: open $BUILD_DIR/$DMG_NAME.dmg"