An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.
TypeScript agentic-browseragentic-browsingagy-cliaiai-agentai-browser-extensionai-toolsbrave-extensionbrowser-agentbrowser-automationbrowser-extensionbrowser-usebrowserskillchrome-extensionclaude-codecodexfirefox-addonmcp-servernanobrowserweb-automation
build(mac): assemble Browsentic.app around the CLI payload and wrap it in a DMG
Shahriar62298e3b9b72
diff --git a/.gitignore b/.gitignoreindex 07b87ee..a2c71f4 100644--- a/.gitignore+++ b/.gitignore@@ -17,6 +17,10 @@ dist/.output/*.tsbuildinfo+# SwiftPM's build tree for the macOS app. The bundle and the DMG land in dist/mac/, which the+# `dist/` rule above already covers.+src/mac/.build/+# WXT generated types + bundle stats.wxt/stats.htmldiff --git a/package.json b/package.jsonindex 63b24ca..9c73377 100644--- a/package.json+++ b/package.json@@ -26,7 +26,9 @@"daemon:restart": "yarn daemon:build && node src/daemon/dist/cli.js restart","daemon:manifest": "yarn daemon:build && node src/daemon/dist/cli.js tools","daemon:link": "cd src/daemon && npm link",- "daemon:unlink": "npm rm -g browsentic @browsentic/mcp"+ "daemon:unlink": "npm rm -g browsentic @browsentic/mcp",+ "mac:app": "yarn build && yarn daemon:build && src/mac/Scripts/build-app.sh",+ "mac:dmg": "yarn mac:app && src/mac/Scripts/make-dmg.sh"},"dependencies": {"@radix-ui/react-scroll-area": "^1.2.16",diff --git a/src/mac/Packaging/Info.plist b/src/mac/Packaging/Info.plistnew file mode 100644index 0000000..f74deb3--- /dev/null+++ b/src/mac/Packaging/Info.plist@@ -0,0 +1,38 @@+<?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>CFBundleDisplayName</key>+ <string>Browsentic</string>+ <key>CFBundleExecutable</key>+ <string>Browsentic</string>+ <key>CFBundleIconFile</key>+ <string>AppIcon</string>+ <key>CFBundleIdentifier</key>+ <string>com.imshaikot.browsentic</string>+ <key>CFBundleInfoDictionaryVersion</key>+ <string>6.0</string>+ <key>CFBundleName</key>+ <string>Browsentic</string>+ <key>CFBundlePackageType</key>+ <string>APPL</string>+ <key>CFBundleShortVersionString</key>+ <string>__VERSION__</string>+ <key>CFBundleVersion</key>+ <string>__BUILD__</string>+ <key>LSApplicationCategoryType</key>+ <string>public.app-category.developer-tools</string>+ <key>LSMinimumSystemVersion</key>+ <string>14.0</string>+ <key>NSHighResolutionCapable</key>+ <true/>+ <key>NSPrincipalClass</key>+ <string>NSApplication</string>+ <key>NSHumanReadableCopyright</key>+ <string>Copyright © 2026 Shahriar. MIT License.</string>+ <key>NSAppleEventsUsageDescription</key>+ <string>Browsentic opens chrome://extensions in your browser so you can load the extension. Browsers refuse that address any other way.</string>+</dict>+</plist>diff --git a/src/mac/Packaging/dmg-readme.txt b/src/mac/Packaging/dmg-readme.txtnew file mode 100644index 0000000..1771ba4--- /dev/null+++ b/src/mac/Packaging/dmg-readme.txt@@ -0,0 +1,19 @@+Browsentic for macOS++Drag Browsentic onto the Applications folder, then open it.++The app checks what your Mac already has, installs what is missing with one click, and+puts the browsentic command, the daemon and the browser extension where they belong:++ ~/.browsentic the command, the daemon, pairing keys, config and logs+ ~/browsentic/extension the unpacked extension your browser loads++The extension sits outside the dotfolder on purpose. Chrome's "Load unpacked" picker+hides dotfolders, and a browser's pairing is tied to the extension's path.++This build is signed ad hoc and is not notarized. If macOS refuses to open it,+right-click the app and choose Open once, or run:++ xattr -dr com.apple.quarantine /Applications/Browsentic.app++Free and open source, MIT. https://browsentic.comdiff --git a/src/mac/Packaging/make-icon.swift b/src/mac/Packaging/make-icon.swiftnew file mode 100644index 0000000..b15cb73--- /dev/null+++ b/src/mac/Packaging/make-icon.swift@@ -0,0 +1,88 @@+// Draws the 1024px app icon: the extension's mark on its ember tile, at macOS icon proportions.+import AppKit++let out = CommandLine.arguments.count > 1 ? CommandLine.arguments[1] : "icon-1024.png"+let size: CGFloat = 1024++func rgb(_ hex: UInt32, _ alpha: CGFloat = 1) -> NSColor {+ NSColor(srgbRed: CGFloat((hex >> 16) & 0xFF) / 255, green: CGFloat((hex >> 8) & 0xFF) / 255, blue: CGFloat(hex & 0xFF) / 255, alpha: alpha)+}++let bitmap = NSBitmapImageRep(+ bitmapDataPlanes: nil, pixelsWide: Int(size), pixelsHigh: Int(size), bitsPerSample: 8, samplesPerPixel: 4,+ hasAlpha: true, isPlanar: false, colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0+)!+NSGraphicsContext.saveGraphicsState()+NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: bitmap)+let context = NSGraphicsContext.current!.cgContext+context.translateBy(x: 0, y: size)+context.scaleBy(x: 1, y: -1)++let tileRect = CGRect(x: 100, y: 100, width: 824, height: 824)+let tile = CGPath(roundedRect: tileRect, cornerWidth: 186, cornerHeight: 186, transform: nil)++context.saveGState()+context.setShadow(offset: CGSize(width: 0, height: 12), blur: 28, color: NSColor.black.withAlphaComponent(0.35).cgColor)+context.addPath(tile)+context.setFillColor(rgb(0x110A06).cgColor)+context.fillPath()+context.restoreGState()++context.saveGState()+context.addPath(tile)+context.clip()+let ground = CGGradient(colorsSpace: CGColorSpace(name: CGColorSpace.sRGB), colors: [rgb(0x201611).cgColor, rgb(0x0E0805).cgColor] as CFArray, locations: [0, 1])!+context.drawLinearGradient(ground, start: CGPoint(x: 0, y: tileRect.minY), end: CGPoint(x: 0, y: tileRect.maxY), options: [])+let halo = CGGradient(colorsSpace: CGColorSpace(name: CGColorSpace.sRGB), colors: [rgb(0x3BE1E1, 0.22).cgColor, rgb(0x3BE1E1, 0).cgColor] as CFArray, locations: [0, 1])!+context.drawRadialGradient(halo, startCenter: CGPoint(x: 512, y: 560), startRadius: 0, endCenter: CGPoint(x: 512, y: 560), endRadius: 420, options: [])+let warmth = CGGradient(colorsSpace: CGColorSpace(name: CGColorSpace.sRGB), colors: [rgb(0xFE804C, 0.16).cgColor, rgb(0xFE804C, 0).cgColor] as CFArray, locations: [0, 1])!+context.drawRadialGradient(warmth, startCenter: CGPoint(x: 860, y: 880), startRadius: 0, endCenter: CGPoint(x: 860, y: 880), endRadius: 380, options: [])+context.restoreGState()++context.addPath(tile)+context.setStrokeColor(rgb(0xFEF7F2, 0.14).cgColor)+context.setLineWidth(3)+context.strokePath()++let unit = tileRect.width / 32+func at(_ x: CGFloat, _ y: CGFloat) -> CGPoint { CGPoint(x: tileRect.minX + x * unit, y: tileRect.minY + y * unit) }+let brand = rgb(0x3BE1E1)++context.setLineCap(.round)+context.addPath(CGPath(roundedRect: CGRect(origin: at(4.25, 6.25), size: CGSize(width: 23.5 * unit, height: 19.5 * unit)), cornerWidth: 5 * unit, cornerHeight: 5 * unit, transform: nil))+context.setStrokeColor(brand.withAlphaComponent(0.55).cgColor)+context.setLineWidth(1.4 * unit)+context.strokePath()++context.move(to: at(4.5, 11.6))+context.addLine(to: at(27.5, 11.6))+context.setStrokeColor(brand.withAlphaComponent(0.35).cgColor)+context.setLineWidth(1.1 * unit)+context.strokePath()+for (x, alpha) in [(7.8, 0.5), (10.8, 0.35)] as [(CGFloat, CGFloat)] {+ let centre = at(x, 8.95)+ context.setFillColor(brand.withAlphaComponent(alpha).cgColor)+ context.fillEllipse(in: CGRect(x: centre.x - 0.9 * unit, y: centre.y - 0.9 * unit, width: 1.8 * unit, height: 1.8 * unit))+}++context.saveGState()+context.setShadow(offset: .zero, blur: 40, color: brand.withAlphaComponent(0.7).cgColor)+context.move(to: at(10, 21.6))+context.addCurve(to: at(16, 15.8), control1: at(12.1, 21.6), control2: at(12.1, 15.8))+context.addCurve(to: at(22, 21.6), control1: at(19.9, 15.8), control2: at(19.9, 21.6))+context.setStrokeColor(brand.cgColor)+context.setLineWidth(1.6 * unit)+context.strokePath()+for (x, y, r, filled) in [(10, 21.6, 2.1, false), (16, 15.8, 2.3, true), (22, 21.6, 2.1, false)] as [(CGFloat, CGFloat, CGFloat, Bool)] {+ let centre = at(x, y)+ let node = CGRect(x: centre.x - r * unit, y: centre.y - r * unit, width: 2 * r * unit, height: 2 * r * unit)+ context.setFillColor((filled ? brand : rgb(0x150D09)).cgColor)+ context.fillEllipse(in: node)+ context.setStrokeColor(brand.cgColor)+ context.setLineWidth(1.45 * unit)+ context.strokeEllipse(in: node)+}+context.restoreGState()++NSGraphicsContext.restoreGraphicsState()+try bitmap.representation(using: .png, properties: [:])!.write(to: URL(fileURLWithPath: out))diff --git a/src/mac/Scripts/build-app.sh b/src/mac/Scripts/build-app.shnew file mode 100755index 0000000..c1b3088--- /dev/null+++ b/src/mac/Scripts/build-app.sh@@ -0,0 +1,68 @@+#!/usr/bin/env bash+# Builds Browsentic.app: the native control panel, with the CLI, the daemon, the bundled skills+# and the extension build carried inside it as Contents/Resources/payload.+#+# It stages and validates; it never builds the JavaScript. Run `yarn build` and+# `yarn daemon:build` first, the same contract src/daemon/scripts/stage-extension.mjs keeps.+set -euo pipefail++MAC="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+REPO="$(cd "$MAC/../.." && pwd)"+DAEMON="$REPO/src/daemon"+EXTENSION="$REPO/dist/chrome-mv3"+DIST="$REPO/dist/mac"+APP="$DIST/Browsentic.app"+ARCHS="${ARCHS:-arm64 x86_64}"++die() { printf '\nbuild-app: %s\n %s\n\n' "$1" "${2:-}" >&2; exit 1; }+field() { /usr/bin/python3 -c "import json,sys;print(json.load(open(sys.argv[1]))['version'])" "$1"; }++[ -f "$EXTENSION/manifest.json" ] || die "no extension build at dist/chrome-mv3" "Run \`yarn build\` at the repository root first."+[ -f "$DAEMON/dist/cli.js" ] || die "no daemon build at src/daemon/dist/cli.js" "Run \`yarn daemon:build\` first."++VERSION="${VERSION:-$(field "$DAEMON/package.json")}"+BUILT="$(field "$EXTENSION/manifest.json")"+[ "$BUILT" = "$VERSION" ] || die "the built extension is $BUILT but the package is $VERSION" "Rebuild it after bumping the version: \`yarn build\`."+grep -q "\"$VERSION\"" "$DAEMON/dist/cli.js" || die "src/daemon/dist/cli.js was not built from $VERSION" "Run \`yarn daemon:build\`."+BUILD_NUMBER="${BUILD_NUMBER:-$(git -C "$REPO" rev-list --count HEAD 2>/dev/null || echo 1)}"++cd "$MAC"+echo "▸ Building Browsentic $VERSION ($BUILD_NUMBER) for: $ARCHS"+slices=()+for arch in $ARCHS; do+ swift build -c release --triple "${arch}-apple-macosx14.0" --product Browsentic+ slices+=(".build/${arch}-apple-macosx/release/Browsentic")+done++mkdir -p "$DIST"+BIN="$DIST/Browsentic.bin"+if [ ${#slices[@]} -gt 1 ]; then+ lipo -create "${slices[@]}" -output "$BIN"+else+ cp "${slices[0]}" "$BIN"+fi++echo "▸ Assembling $APP"+rm -rf "$APP"+mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"+mv "$BIN" "$APP/Contents/MacOS/Browsentic"+sed -e "s/__VERSION__/$VERSION/" -e "s/__BUILD__/$BUILD_NUMBER/" Packaging/Info.plist > "$APP/Contents/Info.plist"+printf 'APPL????' > "$APP/Contents/PkgInfo"++[ -f "$DIST/AppIcon.icns" ] || "$MAC/Scripts/make-icns.sh" "$DIST/AppIcon.icns" "$MAC/Packaging/make-icon.swift"+cp "$DIST/AppIcon.icns" "$APP/Contents/Resources/AppIcon.icns"++# The npm package's layout, because cli.js resolves ../skills and ../extension from dist/.+PAYLOAD="$APP/Contents/Resources/payload"+mkdir -p "$PAYLOAD/dist" "$PAYLOAD/extension"+cp "$DAEMON/dist/cli.js" "$DAEMON/dist/daemon-main.js" "$PAYLOAD/dist/"+cp -R "$DAEMON/skills" "$PAYLOAD/skills"+cp -R "$EXTENSION" "$PAYLOAD/extension/chrome-mv3"+cp "$DAEMON/package.json" "$DAEMON/LICENSE" "$PAYLOAD/"+find "$PAYLOAD" -name .DS_Store -delete++echo "▸ Signing (ad hoc)"+codesign --force --deep --sign "${CODESIGN_IDENTITY:--}" --timestamp=none "$APP"+codesign --verify --verbose=2 "$APP"++echo "✓ $APP"diff --git a/src/mac/Scripts/make-dmg.sh b/src/mac/Scripts/make-dmg.shnew file mode 100755index 0000000..12eadcc--- /dev/null+++ b/src/mac/Scripts/make-dmg.sh@@ -0,0 +1,23 @@+#!/usr/bin/env bash+# Wraps dist/mac/Browsentic.app in a compressed disk image with an Applications shortcut.+set -euo pipefail++MAC="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+REPO="$(cd "$MAC/../.." && pwd)"+DIST="$REPO/dist/mac"+APP="$DIST/Browsentic.app"++[ -d "$APP" ] || { echo "Build the app first: yarn mac:app" >&2; exit 1; }+VERSION="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$APP/Contents/Info.plist")"+DMG="$DIST/Browsentic-$VERSION.dmg"+STAGING="$DIST/dmg-staging"++rm -rf "$STAGING" "$DMG"+mkdir -p "$STAGING"+cp -R "$APP" "$STAGING/"+ln -s /Applications "$STAGING/Applications"+cp "$MAC/Packaging/dmg-readme.txt" "$STAGING/Read Me.txt"++hdiutil create -volname "Browsentic $VERSION" -srcfolder "$STAGING" -ov -format UDZO -fs HFS+ "$DMG" >/dev/null+rm -rf "$STAGING"+echo "✓ $DMG"diff --git a/src/mac/Scripts/make-icns.sh b/src/mac/Scripts/make-icns.shnew file mode 100755index 0000000..6a9380c--- /dev/null+++ b/src/mac/Scripts/make-icns.sh@@ -0,0 +1,23 @@+#!/usr/bin/env bash+# Renders an icon PNG with a Swift script and converts it into an .icns file.+# Usage: make-icns.sh <output.icns> [Packaging/make-icon.swift]+set -euo pipefail++ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+OUT="${1:-$ROOT/dist/AppIcon.icns}"+SCRIPT="${2:-$ROOT/Packaging/make-icon.swift}"+WORK="$(mktemp -d)"+ICONSET="$WORK/icon.iconset"+mkdir -p "$ICONSET" "$(dirname "$OUT")"++swift "$SCRIPT" "$WORK/icon-1024.png" >/dev/null++for size in 16 32 128 256 512; do+ double=$((size * 2))+ sips -z "$size" "$size" "$WORK/icon-1024.png" --out "$ICONSET/icon_${size}x${size}.png" >/dev/null+ sips -z "$double" "$double" "$WORK/icon-1024.png" --out "$ICONSET/icon_${size}x${size}@2x.png" >/dev/null+done++iconutil -c icns "$ICONSET" -o "$OUT"+rm -rf "$WORK"+echo "✓ $OUT"