Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1f3ff70
fix(augment): persist cookie source preference across launches
bcharleson Jan 2, 2026
d431e98
Merge feature/augment-integration: Add Augment provider support
bcharleson Jan 2, 2026
e7f6a1e
fix(augment): remove permissive cookie fallback to match Cursor/Facto…
bcharleson Jan 2, 2026
22f5c52
fix(augment): expand session cookie list and improve discovery logging
bcharleson Jan 2, 2026
5c42395
chore: remove accidentally committed app bundles and improve gitignore
bcharleson Jan 2, 2026
c06d750
Merge branch 'feature/augment-integration'
bcharleson Jan 2, 2026
8f61cee
Merge upstream Vertex AI provider support and bug fixes
bcharleson Jan 4, 2026
ead91ac
Merge feature/augment-integration into main
bcharleson Jan 4, 2026
1ebc493
fix(augment): remove permissive cookie fallback to match Cursor/Facto…
bcharleson Jan 2, 2026
47348a7
fix(augment): expand session cookie list and improve discovery logging
bcharleson Jan 2, 2026
90e97e4
Add automatic session recovery for Augment keepalive
bcharleson Jan 5, 2026
fb287a7
Make Augment keepalive always run and add manual Refresh Session button
bcharleson Jan 5, 2026
0a40a4c
Implement automatic Augment session recovery on expiration
bcharleson Jan 5, 2026
696f6ae
Trigger usage refresh after successful Augment session recovery
bcharleson Jan 6, 2026
89a4ef6
Add Augment CLI integration via auggie command
bcharleson Jan 6, 2026
246f37f
Enhance session keepalive and add encrypted credential storage
bcharleson Jan 6, 2026
d06cd6c
Replace print() with CodexBarLog in session keepalive
bcharleson Jan 12, 2026
7a1dbd7
Merge upstream/main: Linux compatibility and cookie import improvements
bcharleson Jan 12, 2026
0ecf449
Merge upstream/main: sync fork with latest upstream changes
bcharleson Jan 12, 2026
5b75178
Merge feature/sessionkeepalive: Augment CLI integration and session k…
bcharleson Jan 12, 2026
9216d57
test: add augment, kiro, and vertexai to provider icon test
bcharleson Jan 12, 2026
e2c2bda
Merge remote-tracking branch 'upstream/main'
bcharleson Jan 19, 2026
ebeea5c
Merge upstream/main: 189 commits with new providers and features
bcharleson Jan 19, 2026
31e4e6c
Merge remote-tracking branch 'upstream/main'
bcharleson Jan 21, 2026
5179e60
fix(cursor): use plan.limit for usage calculation, not breakdown.total
bcharleson Jan 21, 2026
babf913
Merge remote-tracking branch 'upstream/main'
bcharleson Jan 25, 2026
2c31cc3
fix: use ditto to strip resource forks before code signing
bcharleson Jan 25, 2026
9dd572d
Merge upstream/main: CI improvements and bug fixes
bcharleson Feb 3, 2026
3c3b533
Merge upstream/main: Claude OAuth hardening, keychain improvements, a…
bcharleson Feb 8, 2026
a2da37f
Use authoritative usageUnitsAvailable for Augment credits limit
bcharleson Feb 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions Scripts/diagnose_augment_cookies.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env swift

import Foundation

#if canImport(AppKit)
import AppKit
#endif

// Simple diagnostic script to check Augment cookies in browsers
print("\n========== AUGMENT COOKIE DIAGNOSTICS ==========\n")

let cookieDomains = ["augmentcode.com", "app.augmentcode.com"]
let expectedCookieNames: Set<String> = [
"session",
"_session",
"web_rpc_proxy_session",
"__Secure-next-auth.session-token",
"next-auth.session-token",
"__Secure-authjs.session-token",
"authjs.session-token",
]

print("Looking for Augment cookies in browsers...")
print("Expected cookie names: \(expectedCookieNames.sorted().joined(separator: ", "))\n")

// Check Safari cookies
print("--- Safari ---")
let safariCookiesPath = FileManager.default.homeDirectoryForCurrentUser
.appendingPathComponent("Library/Cookies/Cookies.binarycookies")

if FileManager.default.fileExists(atPath: safariCookiesPath.path) {
print("Safari cookies file exists at: \(safariCookiesPath.path)")
print("Note: Binary cookies file - cannot easily parse without SweetCookieKit")
} else {
print("Safari cookies file not found")
}

// Check Chrome cookies
print("\n--- Chrome ---")
let chromeCookiesPath = FileManager.default.homeDirectoryForCurrentUser
.appendingPathComponent("Library/Application Support/Google/Chrome/Default/Cookies")

if FileManager.default.fileExists(atPath: chromeCookiesPath.path) {
print("Chrome cookies database exists at: \(chromeCookiesPath.path)")
print("Note: SQLite database - cannot easily parse without SweetCookieKit")
} else {
print("Chrome cookies database not found")
}

// Check Arc cookies
print("\n--- Arc ---")
let arcCookiesPath = FileManager.default.homeDirectoryForCurrentUser
.appendingPathComponent("Library/Application Support/Arc/User Data/Default/Cookies")

if FileManager.default.fileExists(atPath: arcCookiesPath.path) {
print("Arc cookies database exists at: \(arcCookiesPath.path)")
print("Note: SQLite database - cannot easily parse without SweetCookieKit")
} else {
print("Arc cookies database not found")
}

print("\n========== INSTRUCTIONS ==========")
print("""
To fix the "No Augment session found" error:

1. Open your browser (Safari, Chrome, or Arc)
2. Go to https://app.augmentcode.com
3. Make sure you're logged in
4. Check the browser's cookies:
- Safari: Develop → Show Web Inspector → Storage → Cookies
- Chrome/Arc: DevTools (⌘⌥I) → Application → Cookies
5. Look for one of these cookie names:
\(expectedCookieNames.sorted().joined(separator: "\n "))
6. If you don't see any of these cookies, you may need to log out and log back in
7. After confirming cookies exist, click "Refresh Session" in CodexBar

If cookies exist but CodexBar still can't find them:
- Try quitting and reopening your browser
- Browser cookies may take a few seconds to write to disk
- Check that CodexBar has Full Disk Access in System Settings → Privacy & Security
""")

print("\n========== END DIAGNOSTICS ==========\n")

92 changes: 92 additions & 0 deletions Scripts/minimize_prompts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash
set -e

echo "🔧 CodexBar Prompt Minimizer"
echo "============================"
echo ""
echo "This script will configure CodexBar to minimize macOS permission prompts."
echo ""

# Check if app is running
if pgrep -x "CodexBar" > /dev/null; then
echo "⚠️ CodexBar is currently running. Please quit it first."
exit 1
fi

echo "📋 Current Configuration:"
echo ""

# Show current provider toggles
echo "Enabled Providers:"
defaults read com.steipete.codexbar providerToggles 2>/dev/null || echo " (none configured yet)"
echo ""

# Show current data sources
echo "Data Sources:"
echo " Claude: $(defaults read com.steipete.codexbar claudeUsageDataSource 2>/dev/null || echo 'auto')"
echo " Codex: $(defaults read com.steipete.codexbar codexUsageDataSource 2>/dev/null || echo 'auto')"
echo ""

echo "🎯 Recommended Configuration (Minimal Prompts):"
echo ""
echo " ✅ Codex (CLI) - No prompts"
echo " ✅ Claude (CLI) - No prompts"
echo " ✅ Gemini (CLI) - No prompts"
echo " ⚠️ Augment - Requires browser cookie prompt (unavoidable)"
echo " ⚠️ Cursor - Requires browser cookie prompt (unavoidable)"
echo " ❌ Antigravity - Disable (experimental)"
echo ""

read -p "Apply recommended configuration? (y/n) " -n 1 -r
echo ""

if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Cancelled."
exit 0
fi

echo ""
echo "🔧 Applying configuration..."

# Set Claude to CLI-only (avoids keychain)
defaults write com.steipete.codexbar claudeUsageDataSource -string "cli"
echo " ✓ Claude → CLI mode (no keychain)"

# Set Codex to CLI-only (avoids keychain)
defaults write com.steipete.codexbar codexUsageDataSource -string "cli"
echo " ✓ Codex → CLI mode (no keychain)"

# Disable Antigravity (experimental, not needed)
defaults write com.steipete.codexbar providerToggles -dict-add antigravity -bool false
echo " ✓ Antigravity → Disabled"

# Keep Augment enabled (user wants it, accepts browser prompt)
defaults write com.steipete.codexbar providerToggles -dict-add augment -bool true
echo " ✓ Augment → Enabled (will prompt for browser cookies once)"

# Keep Claude enabled
defaults write com.steipete.codexbar providerToggles -dict-add claude -bool true
echo " ✓ Claude → Enabled"

# Keep Codex enabled
defaults write com.steipete.codexbar providerToggles -dict-add codex -bool true
echo " ✓ Codex → Enabled"

# Keep Gemini enabled
defaults write com.steipete.codexbar providerToggles -dict-add gemini -bool true
echo " ✓ Gemini → Enabled"

# Disable Cursor (requires browser cookies)
defaults write com.steipete.codexbar providerToggles -dict-add cursor -bool false
echo " ✓ Cursor → Disabled (avoids browser cookie prompt)"

echo ""
echo "✅ Configuration complete!"
echo ""
echo "📝 What to expect:"
echo " 1. First launch: macOS will ask for browser cookie access (for Augment)"
echo " 2. Click 'Allow' ONCE - this is unavoidable for Augment"
echo " 3. No more keychain prompts (Claude/Codex use CLI)"
echo ""
echo "🚀 You can now launch CodexBar."

42 changes: 37 additions & 5 deletions Scripts/package_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ fi
# Embed Sparkle.framework
if [[ -d ".build/$CONF/Sparkle.framework" ]]; then
cp -R ".build/$CONF/Sparkle.framework" "$APP/Contents/Frameworks/"
# Clean extended attributes immediately after copying
xattr -cr "$APP/Contents/Frameworks/Sparkle.framework"
find "$APP/Contents/Frameworks/Sparkle.framework" -name '._*' -delete
chmod -R a+rX "$APP/Contents/Frameworks/Sparkle.framework"
install_name_tool -add_rpath "@executable_path/../Frameworks" "$APP/Contents/MacOS/CodexBar"
# Re-sign Sparkle and all nested components with Developer ID + timestamp
Expand All @@ -309,6 +312,9 @@ function resign() { codesign "${CODESIGN_ARGS[@]}" "$1"; }
resign "$SPARKLE"
resign "$SPARKLE/Versions/B/Sparkle"
resign "$SPARKLE/Versions/B/Autoupdate"
# Clean Updater.app specifically before signing to remove any detritus
xattr -cr "$SPARKLE/Versions/B/Updater.app" 2>/dev/null || true
find "$SPARKLE/Versions/B/Updater.app" -name '._*' -delete 2>/dev/null || true
resign "$SPARKLE/Versions/B/Updater.app"
resign "$SPARKLE/Versions/B/Updater.app/Contents/MacOS/Updater"
resign "$SPARKLE/Versions/B/XPCServices/Downloader.xpc"
Expand All @@ -320,13 +326,20 @@ function resign() { codesign "${CODESIGN_ARGS[@]}" "$1"; }
fi

if [[ -f "$ICON_TARGET" ]]; then
echo "Copying icon from $ICON_TARGET to $APP/Contents/Resources/Icon.icns" >&2
cp "$ICON_TARGET" "$APP/Contents/Resources/Icon.icns"
else
echo "WARNING: Icon file not found at $ICON_TARGET" >&2
fi

# Bundle app resources (provider icons, etc.).
APP_RESOURCES_DIR="$ROOT/Sources/CodexBar/Resources"
if [[ -d "$APP_RESOURCES_DIR" ]]; then
echo "Copying app resources from $APP_RESOURCES_DIR to $APP/Contents/Resources/" >&2
cp -R "$APP_RESOURCES_DIR/." "$APP/Contents/Resources/"
echo "Copied $(ls -1 "$APP_RESOURCES_DIR" | wc -l) resource files" >&2
else
echo "WARNING: App resources directory not found at $APP_RESOURCES_DIR" >&2
fi
if [[ ! -f "$APP/Contents/Resources/Icon-classic.icns" ]]; then
echo "ERROR: Missing Icon-classic.icns in app bundle resources." >&2
Expand All @@ -350,12 +363,13 @@ if [[ ! -d "$APP/Contents/Resources/KeyboardShortcuts_KeyboardShortcuts.bundle"
exit 1
fi

# Ensure contents are writable before stripping attributes and signing.
chmod -R u+w "$APP"
# Strip extended attributes FIRST to prevent AppleDouble (._*) files that break code sealing
# This must happen before any chmod or other operations
xattr -cr "$APP" 2>/dev/null || true
find "$APP" -name '._*' -delete 2>/dev/null || true

# Strip extended attributes to prevent AppleDouble (._*) files that break code sealing
xattr -cr "$APP"
find "$APP" -name '._*' -delete
# Ensure contents are writable after cleaning attributes
chmod -R u+w "$APP"

# Sign helper binaries if present
if [[ -f "${APP}/Contents/Helpers/CodexBarCLI" ]]; then
Expand All @@ -367,6 +381,9 @@ fi

# Sign widget extension if present
if [[ -d "${APP}/Contents/PlugIns/CodexBarWidget.appex" ]]; then
# Clean widget extension before signing to remove any detritus
xattr -cr "${APP}/Contents/PlugIns/CodexBarWidget.appex" 2>/dev/null || true
find "${APP}/Contents/PlugIns/CodexBarWidget.appex" -name '._*' -delete 2>/dev/null || true
codesign "${CODESIGN_ARGS[@]}" \
--entitlements "$WIDGET_ENTITLEMENTS" \
"$APP/Contents/PlugIns/CodexBarWidget.appex/Contents/MacOS/CodexBarWidget"
Expand All @@ -376,6 +393,21 @@ if [[ -d "${APP}/Contents/PlugIns/CodexBarWidget.appex" ]]; then
fi

# Finally sign the app bundle itself
# Use ditto to strip resource forks by copying to temp location and back
# This is the most reliable way to remove all Finder info and resource forks
TEMP_APP="${APP}.tmp"
if [[ -d "$TEMP_APP" ]]; then
rm -rf "$TEMP_APP"
fi
# Copy without resource forks (--norsrc strips resource forks and extended attributes)
ditto --norsrc "$APP" "$TEMP_APP"
# Remove old app and move clean copy back
rm -rf "$APP"
mv "$TEMP_APP" "$APP"
# Final cleanup pass
xattr -cr "$APP" 2>/dev/null || true
find "$APP" -name '._*' -delete 2>/dev/null || true
find "$APP" -name '.DS_Store' -delete 2>/dev/null || true
codesign "${CODESIGN_ARGS[@]}" \
--entitlements "$APP_ENTITLEMENTS" \
"$APP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ public struct AugmentCreditsResponse: Codable, Sendable {
}

public var creditsLimit: Double? {
// Prefer the authoritative total from the API when available.
if let available = self.usageUnitsAvailable, available > 0 {
return available
}
// Fallback: derive from remaining + consumed.
guard let remaining = self.usageUnitsRemaining,
let consumed = self.usageUnitsConsumedThisBillingCycle
else {
Expand Down Expand Up @@ -685,4 +690,4 @@ public struct AugmentStatusProbe: Sendable {
}
}

#endif
#endif
Loading
Loading